Htaccess file help
-
Hi, thanks for looking
i am trying (and failing) to write a htaccess for the following scenario
<colgroup><col width="679"></colgroup>
http://www.gardening-services-edinburgh.com/index.html http://www.gardening-services-edinburgh.com
http://www.gardening-services-edinburgh.com/
|
so that all of these destinations goto the one resource
any ideas?
thanks
andy
-
When I try the url mobile.gardening-services-edinburgh.com/index.html it seems it's being redirected to http://mobile.gardening-services-edinburgh.com/Mobile/ which is generating a 302 to the lost page.
Could you try to take out the last 2 lines - they don't seem to work (adding the trailing slash) and I fear that they are generating this issue.
Like most people on this forum I am not really an expert in regex - you could always try to put your question on a forum like stackoverflow - which is much more technically oriented.
Dirk
-
Hi tried that
heres the code for the.htaccess file
the problem is when you goto our mobile.gardening-services-edinburgh.com/index.html it comes up with a missing webpage
however, when you goto mobile.gardening-services-edinburgh.com without the /index.html it comes up with the correct webpage
any ideas?
thanks
#######################################################################
Diese .htaccess wurde vom STRATO-Webservermanager erstellt
#######################################################################
<ifmodule mod_expires.c="">ExpiresActive On
ExpiresDefault A86400Expires after 1 day
ExpiresByType image/gif A86400
ExpiresByType image/png A86400
ExpiresByType image/jpg A86400
ExpiresByType image/x-icon A86400
ExpiresByType application/pdf A86400
ExpiresByType application/x-javascript A86400
ExpiresByType text/plain A86400Expires after 1 day
ExpiresByType text/css A86400</ifmodule>
mod_gzip_on Yes
<ifmodule mod_deflate.c=""><filesmatch ".(js|css|html|jpg|png|php)$"="">SetOutputFilter DEFLATE</filesmatch></ifmodule>Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^gardening-services-edinburgh.com [NC]
RewriteRule ^(.*)$ http://www.gardening-services-edinburgh.com/$1 [R=301,L]RewriteRule ^index.html$ / [R=301,L]
RewriteRule ^(.*)/index.html$ /$1/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*[^/])$ /$1/ [L,R=301]ErrorDocument 401 http://www.gardening-services-edinburgh.com/Error-Lost-Page.html
ErrorDocument 403 http://www.gardening-services-edinburgh.com/Error-Lost-Page.html
ErrorDocument 404 http://www.gardening-services-edinburgh.com/Error-Lost-Page.html
ErrorDocument 500 http://www.gardening-services-edinburgh.com/Error-Lost-Page.html
-
Hi,
Normally these rules should do the trick:
RewriteEngine On
removes the index (source:http://dense13.com/blog/2012/10/29/removing-index-html-with-mod_rewrite-in-htaccess/)
RewriteRule ^index.html$ / [R=301,L]
RewriteRule ^(.*)/index.html$ /$1/ [R=301,L]adds a trailing slash (source: http://stackoverflow.com/questions/21417263/htaccess-add-remove-trailing-slash-from-url)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*[^/])$ /$1/ [L,R=301]Dirk
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
-
We need a bit of help from someone to fix the following issues causing speed issues on our website.
Hi We need a bit of help from someone to fix the following issues causing speed issues on our website.Does anyone know of someone that can help? Reduce server response time Optimize images Eliminate render-blocking JavaScript and CSS in above-the-fold content Avoid landing page redirects Leverage browser caching Minify CSS Minify JavaScript Minify HTML
Technical SEO | | Bev.Aquaspresso0 -
Joomla creating duplicate pages, then the duplicate page's canonical points to itself - help!
Using Joomla, every time I create an article a subsequent duplicate page is create, such as: /latest-news/218-image-stabilization-task-used-to-develop-robot-brain-interface and /component/content/article?id=218:image-stabilization-task-used-to-develop-robot-brain-interface The latter being the duplicate. This wouldn't be too much of a problem, but the canonical tag on the duplicate is pointing to itself.. creating mayhem in Moz and Webmaster tools. We have hundreds of duplicates across our website and I'm very concerned with the impact this is having on our SEO! I've tried plugins such as sh404SEF and Styleware extensions, however to no avail. Can anyone help or know of any plugins to fix the canonicals?
Technical SEO | | JamesPearce0 -
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 -
Would adding an SSL certificate help my website?
SSL certificates can obviously be a used as a ranking factor by Google, but would a site with no need for an SSL certificate notice a gain by adding one? Is it possible to demonstrate you have an SSL certificate without having some https pages on your site?
Technical SEO | | sthompson0 -
Help - we're blocking SEOmoz cawlers
We have a fairly stringent blacklist and by the looks of our crawl reports we've begin unintentionally blocking the SEOmoz crawler. can you guys let me know the useragent string and anything else I need to enable mak sure you're crawlers are whitelisted? Cheers!
Technical SEO | | linklater0 -
Identified blog issues, anyone able to help?
hi everyone, I have been going through a site recently and i am noticing certain seo errors that are being caused by the blog. Nothing too harmful, but nonetheless i am hoping to correct them. 1 - The seomoz software have identified that i have duplicate title tags on the following http://www.altman.co.uk/blog http://www.altman.co.uk/blog?page=1 http://www.altman.co.uk/blog?page=2 ETC, ETC, ETC... Now am i right that i need to canonicalize those types of urls with the rel="next" and rel="previous"? <colgroup><col width="583"></colgroup>
Technical SEO | | AITLtd
| <colgroup><col width="583"></colgroup>
| <colgroup><col width="583"></colgroup>
| | | |0 -
High pr doc files
I saw that the website www.comunicatedepresa.net outranks www.comunicatedepresa.ro for the therm "comunicate de presa" in google.ro SERP even though .ro beats .net in every seo indicator (links, domains linking, fb likes, g+, onpage etc) I saw that site:www.comunicatedepresa.net returns a lot of *.doc files with a title that contains the kw ("comunicate de presa"). Ex: www.comunicatedepresa.net/worddoc/1485/ It seems a little suspicios to me.Did anyone see this before (google giving higher importance to doc files)? Does anyone know why .net site is ranking better?
Technical SEO | | seo.academy0 -
Has anyone used paid services to help improve their site
Hi, i am getting lots of spam in my mail box about how companies can help you get more traffic and i see on lots of sites about tools that can bring you more traffic and help improve your site, and i am just wondering if anyone has tried any of these services or products to help promote their site. For example, i keep getting sent about submitting my site to over 200 directories or search engines and just wondering if these are a waste of time.
Technical SEO | | ClaireH-1848860