Forum Moderators: phranque
should be redirected to:
/newsdesk_info.php/name/something-something-something/newsPath/1/newsdesk_id/9
in other words in url:
article_info.php >> newsdesk_info.php
cArticlePath >> newsPath
articles_id >> newsdesk_id
Anyone?
Welcome to WebmasterWorld [webmasterworld.com]!
/article_info.php/name/something-something-something/cArticlePath/1/articles_id/9should be redirected to:
/newsdesk_info.php/name/something-something-something/newsPath/1/newsdesk_id/9
in other words in url:
article_info.php >> newsdesk_info.php
cArticlePath >> newsPath
articles_id >> newsdesk_id
RewriteRule ^article\_info\.php/name/(.+)/cArticlePath/(.+)/articles\_id/(.+)$ /newsdesk_info.php/name/$1/newsPath/$2/newsdesk_id/$3 [L]
Ref: Introduction to mod_rewrite [webmasterworld.com]
HTH,
Jim
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
# Alidomain
RewriteCond %{HTTP_HOST} testing.mydomain.net$
RewriteCond %{REQUEST_URI}!shop/
RewriteRule ^(.*)$ shop/$1
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteRule ^article\_info\.php/name/(.+)/cArticlePath/(.+)/articles\_id/(.+)$ /newsdesk_info.php/name/$1/newsPath/$2/newsdesk_id/$3 [R=301,L]
It is in an htaccess file on a shared server. But it should work since the subdomains are working , rigth?
Also none of the files are in the root but have sub domains on them like:
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
# Alidomain
RewriteCond %{HTTP_HOST} www.mysite.net$
RewriteCond %{REQUEST_URI}!catalog2/
RewriteRule ^(.*)$ catalog2/$1
Apologies for the delay - I suspect we're on opposite sides of the world...
I'll have to get back to you on this, but I do see something that may need to be fixed: You have multiple occurrences of Options, RewriteEngine, and RewriteBase directives in your file, and they are in the wrong order.
Place this sequence before any RewriteCond or RewriteRule directives, and include it in each .htaccess file only once:
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
The pattern on the left side of the rule I sent you will match only if your .htaccess file is in a directory that has a subdirectory named "/article". If this is not true, then the code will do nothing.
I'll look at your post again when I get back and see if I can spot anything else wrong. In the meantime, perhaps one of the points above may help, and you might wish to spend some time studying the post I cited above, and the information linked from that post.
HTH,
Jim
Moving the rewrite to a new htaccess file and moving it to the same folder as the files did the trick. And by modifying it I found a way to do three more similar redirects. Thank you for your help. I really appreciate it.