I'd like to ask for some help with this.
From what I've read, mostly here, I've managed to create my .htaccess to work the way I like it. But the problem is, it only works on my localhost, which is on WinXP. When I try the similar (adapted for specific location) to work on Linux it breaks quite strange.
Here's the WinXP version:
- Code: Select all
RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /subdir/
RewriteRule ^(Prefix|prefix)([^\.]+)\.(php|htm)$ http://localhost/subdir/$2 [R=301,L]
RewriteCond %{SCRIPT_FILENAME} -f [OR]
RewriteCond %{SCRIPT_FILENAME} -d
RewriteRule .* - [L]
RewriteRule ^([0-9]+)/?$ this.php?one=$1 [QSA,L]
RewriteRule ^([0-9]+)/([0-9]+)/?$ that.php?one=$1&two=$2 [QSA,L]
RewriteRule ^([0-9]+)/([0-9]+)/([0-9]+)/?$ other.php?one=$1&two=$2&three=$3 [QSA,L]
</IfModule>
Basically, what I'm trying is this.
The first "set of rules" (301's) is to redirect old pages to new ones like:
PrefixPagetitle.htm (or .php) -> Pagetitle
The rest is simple (and it works on Linux version, as well): catch some query strings and create urls from them (the variables are dummies, of course).
Long story short - this works on localhost on WinXP. I don't know if this has something to do with OS or perhaps with the fact that I'm trying this on my ~user account (http://website/~user/subdir).
If additional info is needed, I'll provide it. Sorry for possibly poor English, or if something is badly explained.
Thanks in advance.
Greetz.