PDA

View Full Version : Htaccess rewrite not working



comediaz
07-12-2007, 11:17 AM
Hi,

I have the my htaccess on the main root directory
/public_htmL/mywebsite/

The problem is that the rewriterule doesn't work.

my .htacess:
RewriteEngine on
RewriteBase /
RewriteRule "^([a-z]{1}[\w_\-]+[a-z]{1})$" "/index.php?action=$1" [L]

That should match for example http://www.mywebsite.com/about-us and convert it to http://www.mywebsite.com/index.php?action=about-us. Locally is working the problem is online....

Can you please tell me if I need to enable this on php.ini or what I have to do for the rewrite work in each website individually?

Thanks

Elmono
06-11-2008, 04:27 PM
Hi,

I have the my htaccess on the main root directory
/public_htmL/mywebsite/

The problem is that the rewriterule doesn't work.

my .htacess:
RewriteEngine on
RewriteBase /
RewriteRule "^([a-z]{1}[\w_\-]+[a-z]{1})$" "/index.php?action=$1" [L]

That should match for example http://www.mywebsite.com/about-us and convert it to http://www.mywebsite.com/index.php?action=about-us. Locally is working the problem is online....

Can you please tell me if I need to enable this on php.ini or what I have to do for the rewrite work in each website individually?

Thanks

same problem here, my script worked fine in another server, so i guess the mod is not enabled in the httpd.conf

RewriteEngine on
RewriteRule ^/?inicio\.html$ inicio.php [L]
RewriteRule ^/?buscar\.html$ buscar.php [L]
RewriteRule ^/?masvistos\.html$ masvistos.php [L]
RewriteRule ^/?contacto\.html$ contacto.php [L]

r2b2
06-11-2008, 04:33 PM
mod_rewrite is enabled. Is it a typo that you've called your file .htacess (note spelled incorrectly)?