Mod Rewrite Help
-
I need some help with doing the Mod Rewrite on our htaccess file. Basically I've a URL like this :
www.example.co.uk/new-toy-search?keys=xbox
and I want to rewrite the URL into something else (such as new-toy-search-xbox.html)
Could someone please take me through the steps of how to do this? I've had a look at the Apache site but it's really confusing the way it's explained!
-
Thanks Adam - the generateit tool works like a charm! Bookmarked!
-
Here are two tools that may help you:
http://www.generateit.net/mod-rewrite/
http://www.webmaster-toolkit.com/mod_rewrite-rewriterule-generator.shtml
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Help to decide of domain move reversal after 5 months!
Hello, first sorry for my bad english,it isn't my first lanugage.
Technical SEO | | Milad25
I have a website with 13 years of history and activity. 5 Months ago we received an warning message from our domain provider which would seize our domain because of sanctions (i live in Iran), and they have seized many of iranian domains since then, therefore i have decided to quickly change my domain to another address so i could save my website as much as possible before they take out my domain...
I have moved my website successfully to a new domain address and have done everything necessary for a good domain move (301 all links, change template and...) I have also used the "Change of Address Tool" provided in google search console so google knows my new domain address and change all of my links...
Unfortunately 90% of my traffics comes from google, therefore we are hevaily depending on organic traffic.
Since i have changed my domain address my traffic has been declining, and now i have only 30% of the traffic input left from google compared to my old domain 5 months ago. (i had recently some SEO troubles too which could effect this decline even more)
Fortunately my old domain wasn't seized by the domain provider and i have successfully transfered it to another provide recently so there is no danger for my old domain anymore.
My question is, should i move my website back to my old domain (cancel the google "Change of Address Tool" and use it again to move the new domain back to the old domain)? My old domain has more than 13 Years of history,has many backlinks within this 13years, and till now, i cannot get good rankings with new posts on the new domain, sometimes google even does not index my new articles several days, but my old domain ranks still well (i have tested a new article on the old domain to see how it performs and it was not very good, but i think it ranks still better than my new domain).
My top pages and categories has been redirected successful and are still ranking well on google on the new domain address and hasn't been affected negativly, my main problem are new posts that are not ranking well o even does not get indexed for several days!
I don't know what to do now, are 5months not enough for google to completly transfer all domain scores from my old domain to the new one? Will all scores of my old domain even transfer to my old domain eventually? How about the many Backlinks i have pointed to the old domain? (which 90% i cannot change or ask to change to my new address) Will the backlinks scores pointing to the old domain transfer to the new domain?In other hand i fear to move my site back to the old domain because i don't know how google would behave, would all my seo score and rankings come back after i move back to the old domain? Also as far as i know, after 6months of using the google "Change of Address Tool" i cannot cancle the domain change anymore, therefore i have roughly 1 month to decide to cancle the move or not...
Please if anyone could help or guide me what to do it would be life saving for me, because my whole income and my family depends on my website... 😞0 -
Href lang issues - help needed!
Hi, I have an issue with Google indexing the US version of our website rather than the UK version on Google.co.uk. I have added hreflang tags to both sites (https://www.pacapod.com/ and https://us.pacapod.com/), have updated and submitted an XML sitemap for each website and checked that the country targeting in search console is set-up correctly but Google are still indexing the wrong website. I would be grateful for any assistance with this issue. Many thanks Eddie
Technical SEO | | mypetgiftbox0 -
Link Spam from Competitor Help
A clients link profile is recently getting lots of spam links related to "abortion pills" and "does my husband cheat" I found a few of the sites that link, and it appears that there is some malicious code on the site injecting links at the top of the site. http://www.med-reporter.at/index.asp?men=Gesundheit&submen=Produkte&artid=1587&kategorie=&blockzl=3 Can anyone look at the link above and tell me what network or software is creating these links?
Technical SEO | | webbroi0 -
How is this possible? A 200 response and 'nothing' to be seen? Need help!
On checking this website http://dogtraining.org.uk/ I get a 200 response. But an Oops! Google Chrome could not find dogtraining.org.uk . Same with Firefox (Server not found). Obviously there is a problem - I just don't know where to 'start' investigating to spot the error. Can someone help me? Thank you!
Technical SEO | | patrihernandez0 -
Can you help me understand leveraging semantic markup
Hi, i am trying to understand about leveraging semantic markup but even though i have read the page on the link, i am still not sure of what it means and how i can use it in my site www.in2town.co.uk which has been built using joomla If anyone can help me understand then that would be amazing and help me understand how it would benefit my site.
Technical SEO | | ClaireH-1848860 -
Htaccess Rewrites
Hi, I'm battling with duplicate content and would love to fix some redirections in my htaccess file: 1. I'm trying to use the www version of my site via 301 2. I'm trying to remove ALL /index.php from my url's I currently have the following code, but my home page /index.php is still not redirecting to the root? Options +FollowSymLinks
Technical SEO | | Klement69
Options +Indexes <ifmodule mod_rewrite.c="">RewriteEngine On
#RewriteBase / RewriteCond %{HTTP_HOST} ^funeralcoverfinder.co.za$ [NC]
RewriteRule ^(.*)$ http://www.FuneralCoverFinder.co.za/$1 [R=301,NC,L] RewriteCond %{QUERY_STRING} base64_encode[^(]([^)]) [OR]
RewriteCond %{QUERY_STRING} (<|%3C)([^s]s)+cript.(>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|[|%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|[|%[0-9A-Z]{0,2})
RewriteRule .* index.php [F] RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} /component/|(/[^.]|.(php|html?|feed|pdf|vcf|raw))$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]</ifmodule> Any Advice? - Thanks so much!0 -
Ways of Helping Reducing Duplicate Content.
Hi I am looking to no of anyway there is at helping to reduce duplicate content on a website with out breaking link and affecting Google rankings.
Technical SEO | | Feily0 -
URL rewriting causing problems
Hi I am having problems with my URL rewriting to create seo friendly / user friendly URL's. I hope you follow me as I try to explain what is happening... Since the creation of my rewrite rule I am getting lots of errors in my SEOMOZ report and Google WMT reports due to duplicate content, titles, description etc For example for a product detail, it takes the page and instead of a URL parameter it creates a user friendly url of mydomain.com/games-playstation-vita-psp/B0054QAS However in the google index there is also the following friendly URL which is the same page - which I would like to remove domain.com/games-playstation-vita/B0054QAS The key to the rewrite on the above URLs is the /B0054QAS appended at the end - this tells the script which product to load, the details preceeding this could be in effect rubbish i.e. domain.com/a-load-of-rubbish/B0054QAS and it would still bring back the same page as above. What is the best way of resolving the duplicate URLs that are currently in the google index which is causing problems The same issue is causing a quite serious a 5XX error on one of the generated URLs http://www.mydomain.com/retailersname/1 - , if I click on the link the link does work - it takes you to the retailers site, but again it is the number appended at the end that is the key - the retailersname is just there for user friendly search reasons How can I block this or remove it from the results? Hope you are still with me and can shed some light on these issues please. Many Thanks
Technical SEO | | ocelot0