Basic URL ReWrite
4 posts
• Page 1 of 1
Basic URL ReWrite
Hey,
I have been attempting to do a URL ReWrite for a few days now and am not having much success. I have 161 URLs that either need to be Search Engine Friendly or 301 redirected, but I am just focusing on the ReWrites right now.
Current URL: http://mysite.com/special-needs/easy-to ... -in-gravy/
New URL: http://mysite.com/dog-food/easy-digesti ... uts-recipe
My Code:
RewriteEngine on
Rewritebase /
Rewriterule ^special-needs/easy-to-digest/lamb-rice-and-barley-cuts-in-gravy/$ dog-food/easy-digestion/lamb-rice-barley-cuts-recipe [NC,R=301,L]
All this does at this time is redirect me to the new URL it does not display the page. What am I missing?
I have been attempting to do a URL ReWrite for a few days now and am not having much success. I have 161 URLs that either need to be Search Engine Friendly or 301 redirected, but I am just focusing on the ReWrites right now.
Current URL: http://mysite.com/special-needs/easy-to ... -in-gravy/
New URL: http://mysite.com/dog-food/easy-digesti ... uts-recipe
My Code:
RewriteEngine on
Rewritebase /
Rewriterule ^special-needs/easy-to-digest/lamb-rice-and-barley-cuts-in-gravy/$ dog-food/easy-digestion/lamb-rice-barley-cuts-recipe [NC,R=301,L]
All this does at this time is redirect me to the new URL it does not display the page. What am I missing?
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Basic URL ReWrite
And now you do the opposite to let server know where to take data from for this new URL:
Simply add this rule to an existing.
Regards
Andrew
- Code: Select all
Rewriterule ^dog-food/easy-digestion/lamb-rice-barley-cuts-recipe$ special-needs/easy-to-digest/lamb-rice-and-barley-cuts-in-gravy/ [NC,L]
Simply add this rule to an existing.
Regards
Andrew
Re: Basic URL ReWrite
Thanks for the fast response it has worked great for my needs.
My next task has been to redirect some dead links that appear in Search Engines to the homepage of my site.
I haven't been able to accomplish this as I think my rules will not allow me to direct the user to a file in the root directory.
Dead Link: Example.com/siteloader.swf
Homepage: Example.com/default.htm
The below has worked on other pages to direct them correctly, but I cannot direct any files to a file in the root directory.
RewriteEngine on
Rewritebase /
Rewriterule ^dog_easy_to_digest\.aspx$ special-needs/easy-to-digest/fish-meal-and-potato/ [NC,R=301,L]
My next task has been to redirect some dead links that appear in Search Engines to the homepage of my site.
I haven't been able to accomplish this as I think my rules will not allow me to direct the user to a file in the root directory.
Dead Link: Example.com/siteloader.swf
Homepage: Example.com/default.htm
The below has worked on other pages to direct them correctly, but I cannot direct any files to a file in the root directory.
RewriteEngine on
Rewritebase /
Rewriterule ^dog_easy_to_digest\.aspx$ special-needs/easy-to-digest/fish-meal-and-potato/ [NC,R=301,L]
Re: Basic URL ReWrite
I was able to work this out after searching the forums here for a second day. The code is as follows for anyone with a similar problem.
RewriteEngine on
Rewritebase /
RewriteRule ^siteloader\.swf$ / [NC,R=301,L]
RewriteEngine on
Rewritebase /
RewriteRule ^siteloader\.swf$ / [NC,R=301,L]
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 0 guests