- This topic is empty.
-
AuthorPosts
-
August 11, 2009 at 8:19 pm #25730
mattvot
MemberUsing the following .htaccess I could go to site.com/about/ and that would work fine, but site.com/about (without the last / ) would not work.
Code:Options +FollowSymLinks
RewriteEngine On
RewriteBase /RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-fRewriteRule ^(.*)/$ ./index.php?p=$1
ErrorDocument 404 /404/
But doing this won’t work either
Code:Options +FollowSymLinks
RewriteEngine On
RewriteBase /RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-fRewriteRule ^(.*)/$ ./index.php?p=$1
RewriteRule ^(.*)$ ./index.php?p=$1ErrorDocument 404 /404/
Anyone know how I can solve this? Thanks
August 12, 2009 at 4:47 am #62121mattvot
MemberYeh, that’s where I got the idea off of lol. That’s fine, site.com/about will work, but not site.com/about/. It’s very weird
August 12, 2009 at 9:52 am #62141mattvot
MemberThanks so much, but it still doesn’t work. I understand why your solution should work, but mine does not. I looked at the page you referred from and I looked at the fist option of making both trailing slash and no trailing slash work. I figure its better to see why this doesn’t work before forcing the /. It works because the trailing slash has the REGEX optional character ? stating that the trailing slash is optional, yet it doesn’t work.
I’ve attached a much striped down version of the site I use so you don’t have to set up your own PHP engine for managing pages. Thanks for your help. I am totally confused. The site (a web app) will eventually help all designers and developers.
August 12, 2009 at 11:10 am #62143mattvot
MemberHum, I just uploaded the attached file onto my test domain.
http://votsikas.com/htaccesshelp/
It works.
http://votsikas.com/htaccesshelp/index.php?p=about
http://votsikas.com/htaccesshelp/index.php?p=contact
http://votsikas.com/htaccesshelp/index.php?p=404
http://votsikas.com/htaccesshelp/index. … 4f4f45tf5t [none exsistant, returns 404]Some weird things happening today
August 12, 2009 at 2:26 pm #62150mattvot
MemberYeh, it’s weird. I don’t understand .htaccess. It’s like you spend all this time learning and then its a waste when, probably, such a small thing is not working, and it could be probably be so simple, nobody covers it in their tuts. Arrgh, help please ;)
-
AuthorPosts
- The forum ‘Other’ is closed to new topics and replies.