Southperry.net
Need quick apache help - Printable Version

+- Southperry.net (https://www.southperry.net)
+-- Forum: Social (https://www.southperry.net/forumdisplay.php?fid=14)
+--- Forum: Rubik's Cube (https://www.southperry.net/forumdisplay.php?fid=58)
+--- Thread: Need quick apache help (/showthread.php?tid=26331)



Need quick apache help - Fiel - 2010-06-06

For some reason, I forgot how to do this with mod_rewrite.

Okay. I have a bunch of files like this:

http://www.example.com/200.php
http://www.example.com/300.php
http://www.example.com/400.php

So on and so forth. But, I only want people to type in:

http://www.example.com/200

and it will redirect them to:

http://www.example.com/200.php

I cannot use Redirect 301's, I can only use mod_rewrite

Any help?


Need quick apache help - XTOTHEL - 2010-06-06

copy pasteahhhhh

Quote:RewriteEngine On
RewriteCond %{REQUEST_URI} !^(.*)\.(.*)$
RewriteRule ^(.*)$ %{REQUEST_URI}.php [R]



Need quick apache help - Fiel - 2010-06-06

Thanks X->L, but now I just realized my webhost isn't processing my .htaccess file. O_o

I put "deny from all" line and didn't get a 403 error.


Need quick apache help - Yotsuba - 2010-06-06

Wouldn't it be easier to do it with mod_alias than mod_rewrite? That's how I'd think of doing something like this. I've never done something like this since my server is just for private use. I'll test a bit, give me a second.


Need quick apache help - Nikkey - 2010-06-06

Check your error-log. If no reference to .htaccess is around, check AllowOverride, even though you've probably already checked that.


Need quick apache help - Fiel - 2010-06-06

Shared hosting, so there's no error log to check. After looking around, it seems that it takes several hours for .htaccess to get enabled on my host (previously disabled). Thanks for the help, guys. I'll just wait for it to get enabled.