Welcome Guest, Not a member yet? Register   Sign In
Two Quick Questions (htaccess)
#1

[eluser]jed726[/eluser]
Hi everyone! I have two quick questions that I hope you can help me out with. First off, here is the code I currently have in my htaccess to remove index.php, and it works like a charm:

Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|assets|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

1) How can I modify this to allow direct access to another php file in the same directory as index.php? (Let's call it file1.php for example's sake.)

2) If the htaccess is placed in the webroot, are its rules inherited in all sub-directories? The reason I ask is that I have a different website in one of my sub-dir's and the links are not working as they are supposed to...could this be due to the htaccess rules defined in its parent folder?

Thank you and I appreciate your assistance!

-jD
#2

[eluser]Randy Casburn[/eluser]
Hi,

1) I'm fairly certain this will do the trick. I'm no .htaccess expert though...
Code:
RewriteEngine on
RewriteCond %{REQUEST_URI} !exactfilenamehere.php$
RewriteCond $1 !^(index\.php|images|assets|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

2) Yes, you'll need a different .htaccess file in your other root folder of the other "web site". Set some default security rules or just set RewriteEngine off in that file.

Randy
#3

[eluser]jed726[/eluser]
Awesome Randy...it works beautifully. Thank you!




Theme © iAndrew 2016 - Forum software by © MyBB