Jump to content

[SOLVED] Mod_rewrite help - REdirect


Recommended Posts

Hello.

 

I have this code:

Options +FollowSymLinks 
RewriteEngine On
RewriteBase /
RewriteRule ^([^/]+)?/?$ index.php?do=$1 [L,QSA]

 

Which works fine for what i need it for eg: www.mydomain.com/google.com

 

but if i want to show a subdirectory they it messes it up eg mydomain.com/subdirectory/ UNLESS i use eg mydomain.com/subdirectory/index.php.

 

Any ideas how i can allow subdirectories?

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/161866-solved-mod_rewrite-help-redirect/
Share on other sites

No, youll have to add the rewrite to it, just treat it like the root directory

 

The directory htaccess will overwrite the root htaccess

 

http://site.com/dir/.htaccess

 

Options +FollowSymLinks
RewriteEngine On
RewriteRule ^$ index.php

 

So http://site.com/dir/ will go to http://site.com/dir/index.php

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.