Forum Moderators: phranque
I have a website, there are two directories under the root directory, one /abc and the other /xyz
I have a script which sydicates with allposters to generate an allposters affiliate website, it is written in php and there are several variables, like php?cat=****&sub=yyy ...
I have modified the script and use mod_rewrite to generate static pages. So my URL now is in this format /abc/123/456/ instead of /abc/php?cat=123&sub=456
The problem is that, whenever I visit mysite/abc I get this error:
Error: Please use the domain-name instead of the IP-address!
But it's okay if browsing mysite/abc/
If I visit mysite/abc/123, I get 404: File not found error.But it is okay if I browse mysite/abc/123/
It is weird. Because Trailing Slash is supposed not to be a problem. Say, when browsing mysite/xyz, it is okay.
I add lines below to my htaccess:
RewriteEngine on
RewriteBase /abc/
RewriteRule ^(.*)$ $1/
RewriteRule ^(.+)$ $1/ [L] But the problem still exists. Any idea? Thanks
Trailing slashes are not problem as long as you don't use mod_rewrite, or if you use it, you use it only for (fully qualified or absolute) external redirection and for proxy requests, but if you start using mod_rewrite to rewrite the urls, then you have to be carefull with them. I sugegst you to post all of your rewriting settings, this sounds as if it were something wrong in the one which translates the /abc/123/456/ url into /abc/php?cat=123&sub=456. by the way, what's the /abc/php? It is a typo, or an another rewriting?
This might work better - or maybe not:
Options +FollowSymlinks
RewriteEngine on
RewriteBase /abc/
RewriteRule ^id-([^.]+)\.html$ another_script.php?id=$1 [L]
RewriteRule ^([^/]+)/(.+)/?$ script.php?var=$1&var2=$2 [L]
RewriteRule ^(.+)/?$ script.php?var1=$1 [L]