Forum Moderators: phranque
# iPhone
RewriteRule ^iphone/?$ /index.php?a=iphone-home&categoryslug=$1 [QSA,L]
RewriteRule ^iphone/([1000-9999]+)/([^/]+)/([^/]+)/([^/]+)/?([0-99]+)?$ /index.php?date=$1/$2/$3&slug=$4&a=iphone-show-post&commentspage=$5 [L,QSA]
RewriteRule ^iphone/category/([^/]+)/?$ /index.php?a=iphone-category&categoryslug=$1 [L]
RewriteRule ^iphone/tag/([^/]+)/?$ /index.php?a=iphone-tag&tag=$1 [L]
#
RewriteRule ^iphone/tag/([^/]+)/page/([0-9999]+)/?$ /index.php?a=iphone-tag&tag=$1&postpage=$2&i=true [L,QSA]
RewriteRule ^iphone/category/([^/]+)/page/([0-9999]+)/?$ /index.php?a=iphone-category&categoryslug=$1&postpage=$2 [L,QSA]
RewriteRule ^iphone/page/([0-9999]+)/?$ /index.php?a=iphone-home&postpage=$1 [QSA,L]
the last 3 rewrites are for pagination. however they don't work.
Now the url shows up as
category - pl.example.com/category/catname/page/pagenum where as it must be pl.engadget.com/iphone/category/catname/page/pagenum
same type of urls must be constructed for tags and articles as well.
Please help
Cheers
Lokesh
[edited by: jdMorgan at 3:31 pm (utc) on Sep. 17, 2008]
[edit reason] Use example.com please. [/edit]
The mod_rewrite code here takes an incoming client-requested URL from a browser (or robot) and points it to your script so that content can be generated and served. This is a URL-to-filename rewrite, and does not affect the client. So if your URLs are "showing up wrong," then you must modify the script that generates those URLs for use in your on-page links, and then perhaps modify your rules above so that these URLs are "connected to" your script to generate the proper page content.
As a general rule, I suggest that you put your rules in order from longest/most-specific-patterns first to shortest/least-specific pattern last. This will avoid unexpected interactions. On review, that is not what is causing the problem here, however.
Jim
# iPhone
RewriteCond %{HTTP_HOST} ^i\.
RewriteRule ([1000-9999]+)/([^/]+)/([^/]+)/([^/]+)/?([0-99]+)?$ /index.php?date=$1/$2/$3&slug=$4&a=iphone-show-post&commentspage=$5&i=true [L,QSA]
RewriteCond %{HTTP_HOST} ^i\.
RewriteRule ^$ /index.php?i=true&a=iphone-home [L,QSA]
RewriteCond %{HTTP_HOST} ^i\.
RewriteRule ^page/([0-9999]+)/?$ /index.php?a=iphone-home&postpage=$1&i=true [L,QSA]
RewriteCond %{HTTP_HOST} ^i\.
RewriteRule ^category/([^/]+)/page/([0-9999]+)/?$ /index.php?a=iphone-category&categoryslug=$1&postpage=$2 [L,QSA]
RewriteCond %{HTTP_HOST} ^i\.
RewriteRule ^category/([^/]+)/?$ /index.php?a=iphone-category&categoryslug=$1 [L]
RewriteCond %{HTTP_HOST} ^i\.
RewriteRule ^tag/([^/]+)/?$ /index.php?a=iphone-tag&tag=$1 [L]
RewriteCond %{HTTP_HOST} ^i\.
RewriteRule ^tag/([^/]+)/page/([0-9999]+)/?$ /index.php?a=iphone-tag&tag=$1&postpage=$2 [L,QSA]
As I said earlier, since I am pretty new to apache, I am just trying to modify the above for pl.example.com/iphone. Could you please help. I know I am asking for too much, however i am kinda helpless here:)
Thanks so much
[edited by: jdMorgan at 3:55 pm (utc) on Sep. 17, 2008]
[edit reason] Please use example.com only [/edit]
Note : i is the subdomain for example.com and iphone is the subdomain for pl.example.com
Please help. Thanks in advance
[edited by: jdMorgan at 12:37 pm (utc) on Sep. 18, 2008]
[edit reason] Please use example.com only [/edit]