Forum Moderators: phranque

Message Too Old, No Replies

htaccess mod rewrite problem - please help

         

apche newbie

7:38 am on Sep 19, 2008 (gmt 0)

10+ Year Member



Hey
Rewrite Conditons
Note : My host is sd.example.com
How do i check if my host has a subdomain (sd from sd.example.com)
and
How do i check if the present url's path text (/dir1/ or /dir1 from sd.example.com/dir1 or sd.example.com/dir1#_blahhh or sd.example.com/dir1/whatever/stuff/here/....)

One more thing is, if the above condtions are true, the pagination URL should be [sd.example.com...] and my htaccess I though of is;
RewriteRule ^dir1/tag/([^/]+)/page/([0-9999]+)/?$ /index.php?a=my-tag&tag=$1&postpage=$2 [L,QSA]

does not seem to work. please help

jdMorgan

1:28 pm on Sep 19, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



#1 See Apache mod_rewrite documentation: RewriteCond %{HTTP_HOST}
#2 Don't fully understand this. The URL is usually checked by the RewriteRule pattern or RewriteCond %{REQUEST_URI}
#3 ^dir1/tag in the pattern does not match dir1/page in the requested URL.

Jim

apche newbie

10:14 am on Sep 21, 2008 (gmt 0)

10+ Year Member



Hey, sorry for being not clear
Rewrite Conditons
Note : My host is sd.example.com

How do i check if the present url's path text ("/dir1" from; sd.example.com/dir1
OR
sd.example.com/dir1#_blahhh
OR
sd.example.com/dir1/whatever/stuff/here/....)

Here I want to check if my request URI has "/dir" as the 1st path element like "user" from [sub.example.com...] OR [sub.example.com...] OR [sub.example.com...]

One more thing is, if the above condtions is true, the pagination URL should be "http://sd.example.com/dir1/tag/tagename/page/pagenum" and my htaccess I thought of is;
RewriteRule ^dir1/tag/([^/]+)/page/([0-9999]+)/?$ /index.php?a=my-tag&tag=$1&postpage=$2 [L,QSA]

Please help