http://abc.com/forum/forum/topic/topic-1/
to
http://abc.com/forum/topic/topic-1/
please help me to write htaccess rule to get above url .
I want to remove extra 'forum' from the url.
Try this code inside htaccess file:
redirect http://abc.com/forum/forum/topic/topic-1/ http://abc.com/forum/topic/topic-1/
Related
Is that possible with .htaccess to redirect like this
example.com/page1-sometext-book to example.com/page1-sometext-booking
example.com/page2-onlytext-book to example.com/page2-onlytext-booking
...
example.com/textN-book to example.com/textN-booking
Thank you.
I have a URL http://domain.com/foo/bar/100. I want to remove /foo/bar from the URL without redirecting it.
Please help me with this problem as I am new for htaccess.
is this URL created by .htaccess rules?
if not: change your document root or add a location directive to the server.
So I'm trying to rewrite the following example. Took a look around but couldn't find the correct post that matched this scenario.
Here is a list of layout for old pages:
www.url.com/directory
www.url.com/directory/page1.html
www.url.com/directory/page2.php
I'm trying to rewrite the following way through htaccess:
Redirect 301 /directory /newdirectory
Redirect 301 /directory/page1.html /newdirectory/page1
Redirect 301 /directory/page2.php /newdirectory/page2
However, the first rewrite rule is interfering with old subpages in that path. So for example, using the above rewrite rules, going to:
www.url.com/directory/page1.html
Points the user to:
www.url.com/newdirectory/page1.html
When it should be pointing user to the slug without the original filename extension:
www.url.com/newdirectory/page1
The only way around this that I've been able to manage is to leave out the www.url.com/newdirectory/page1.html rule entirely. But there are a bunch of links pointing to that base path, so I'd like to redirect that.
Any help would be greatly appreciated. Thanks in advance for the time and help.
url-rewriting redirect rewrite-rules
You need to place the rule for the base directory after the ones for the subpages :
Redirect 301 /directory/page1.html /newdirectory/page1
Redirect 301 /directory/page2.php /newdirectory/page2
Redirect 301 /directory /newdirectory
I want to redirect url in magento. I am using "URL rewrite Management".
We want this path "/index.php?cPath=1" redirect to "baby-prams-strollers.html" this path.
I have entering data this type
Request Path * index.php?cPath=1
Target Path baby-prams-strollers.html
But it will be redirect on homepage. we want to redirect on baby-prams-strollers.html this path. How can we do this? Please advice me.
If we have entered this type of data
Request Path * ?cPath=1
Target Path baby-prams-strollers.html
Now it will be redirected on "baby-prams-strollers.html" this path but url is coming with index.php/baby-prams-strollers.html. Now we don't need index.php in URL. How can we remove index.php in this URL. We have already removed index.php in our all url. but when we redirection of this type url that time it will be added url in index.php.
Thanks in advance.
You need to add to your .htaccess file in your Magento root folder soomething like this:
RedirectMatch 301 /index.php?cPath=1(.*) /baby-prams-strollers.html$1
I will present a to the point example.
I have a domain name as: www.abc.com
And another domain name as: www.123.com
Now i want to write a rewritemodule in .htaccess for the following case:
If i request a url like: www.123.com/xyz
It will redirect my request to www.abc.com/track/index.php?ext=xyz
Also please tell me on which directory i should keep that .htaccess file.
Thanks.
In the root folder of www.123.com, you would create an htaccess file with the following line:
RedirectMatch 301 (.*) www.abc.com/track/index.php?ext=$1
Since you are doing an external redirect, it is not necessary to use mod_rewrite.