mod_rewrite on add-on domains doesn't work?

tomaszjot

Membership Suspended
Dec 22, 2009
1,934
77
0
Albany Plantation
So I want to have clean URLs for my hand coded site. Insted of

myshittysite.com/category.php?category=something

something like

myshittysite.com/category/something.html

I created .htaccess file in the root of add-on domain

Inside I wrote something like that (that is ALL my htaccess file contains):

RewriteEngine On
RewriteRule ^category/([^/]*)\.html$ /category.php?category=$1 [L]

It doesn't work. If the problem is with my code inside htaccess I would be happy to work on it.

But if it something with hosting setting (possible?) or add-on domain (does it make any difference for htaccess?) than.. I don;t know.

Any help much appreciated, thanks.
 


What you wrote inside .htaccess looks good, I think. Although it shouldn't make a difference, the way you are using the * doesn't make sense, use a + instead. And generally to be safe, be more specific with your character classes like instead of [^/] use [a-zA-Z0-9\-] or whatever characters you want to allow. I use .htaccess in my hostgator shared add-on domains with no problem. Try something like:

RewriteRule ^one.html$ /two.html [L]

If visiting one.html doesn't display the contents of two.html then you must have some kind of server setting issue.
 
What you wrote inside .htaccess looks good, I think. Although it shouldn't make a difference, the way you are using the * doesn't make sense, use a + instead. And generally to be safe, be more specific with your character classes like instead of [^/] use [a-zA-Z0-9\-] or whatever characters you want to allow. I use .htaccess in my hostgator shared add-on domains with no problem. Try something like:

RewriteRule ^one.html$ /two.html [L]

If visiting one.html doesn't display the contents of two.html then you must have some kind of server setting issue.

Thanks lschmidt

I suppose I have some setting issues, will try again but it looks like its not the code.