Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

3
votes
2answers
251 views

prevent hotlinking of off-site content?

I have a www.example.com site where I serve all static content (e.g. http.//www.example.com/image.jpg) off a CDN with URLs like http://static.example.com/image.jpg An Apache 2 .htaccess rule ...
3
votes
1answer
3k views

How to redirect specific url to 404 in htaccess?

I want to redirect only one specific URl (ex. mypage.com/1234/page/) to error page 404. How to achieve it in htaccess?
3
votes
1answer
219 views

How can I redirect all files in a directory that doesn't conform to a certain filename structure?

I have a website where a previous developer had updated several webpages. The issue is that the developer had made each new webpage with new filenames, and deleted the old filenames. I've worked with ...
3
votes
1answer
141 views

.htaccess Redirect Old Threads

I have moved to mybb to vanilla and want to redirect old threads to the new format, so the indexed threads on google aren't lost. The old format is showthread.php?tid=3003 Whereas the new ...
3
votes
2answers
330 views

Create friendly looking URL's with mod rewrite

I want to make the pages on my site more search engine friendly by turning the query strings into meaningful looking page names. For example I have a page that is this: /search.php?c=18 I want it ...
3
votes
4answers
2k views

How to create .htaccess to block access to a subdirectory that hosts a separate domain

So I am pretty noob at with creating code in .htaccess, but I know it is what I need to accomplish a pretty simple task. So here is what I want to do. I have a main domain, (me.com), and I am hosting ...
3
votes
2answers
69 views

How does one redirect from one wordpress page to another via htaccess?

I tried making the following change to my wordpress site to permanently redirect a common link to a new page. I could've -sworn- that this used to work. But it simply does not (at least in WP 3.9). I ...
3
votes
1answer
54 views

Best way to move site from subdomain to root through cPanel?

I have an old Wordpress blog hosted on a subdomain (sub.mysite.com) with hundreds of posts. The root domain is actually empty and redirected to the subdomain. Now I want to move the site from the ...
3
votes
1answer
115 views

htacess seems to make the page load forever

I need to rewrite a URL of my server so the URL looks friendly. Like: site.com/var1/var2/var3/... to site.com/index.php?page=var1/var2/var3/... So I wrote this .htacess: RewriteEngine On ...
3
votes
1answer
59 views

Make a domain point to another domain

I have never been able to figure out how to do this. I am working on a PHP script. With my script, each user will have access to their own site. For example, the URL for this would be ...
3
votes
1answer
955 views

Using .htaccess to set a cookie and 301 redirect

I currently have in my .htaccess: RewriteRule ^$ http://chfmaine.com/ [CO=moved:yes:chfmaine.com:1/,R=301,NE,NC,L] I was basing this off of this post. That's a lot more than I need but the setting ...
3
votes
1answer
309 views

URL/Crawl Errors continue to increase after pharma hack

I'm working with a site that was hacked a couple of months ago and was sending out a ton of spam. The problem seemed to have started with a dormant WordPress blog that was part of the site (so the ...
3
votes
1answer
95 views

Moving a WordPress site to a new domain - need help with an Apache htaccess URL rewrite rule

I'm helping to move a WordPress site from one domain to another, which includes a change in permalink structure. I know I can use a .htaccess entry, but I'm not that well-versed (yet) in regular ...
3
votes
1answer
649 views

How can I redirect old WordPress URL (with a query string) to new URL using .htaccess?

I transferred my WordPress site to static HTML website, but some other website have a link to my old WordPress site mysite.com/?page_id=1103. I want to redirect all traffic to new URL which is ...
3
votes
1answer
371 views

Removing file extensions off the url

I am looking for a way to remove the extensions off the end of the Url. So say for example www.example.com/about.html. This would change to www.example.com/about I've looked around and searched for ...
3
votes
1answer
256 views

RewriteRule for URL Subdirectory Root

Have not found this in my searches on SE. I need this scenario to work: • User visits someurl.com/news/folder or someurl.com/news/somefolder/, they get redirected to someurl.com/somefolder. • If ...
3
votes
1answer
156 views

301 redirect for a page with a space in it

I have some pages from a client's old template-based site which have spaces in them. For example, one of the pages looks like this: example.com/page.php?domain_name=example.com&viewpage=Gallery ...
3
votes
1answer
701 views

Wild card redirect in htaccess giving error this webpage has a redirect loop

In my website I changed the directory name "vehicles-cars" to "vehicles-cars-for-sale". When I tried to redirect using a wild card redirect from my old directory name to new directory name in my web ...
3
votes
2answers
4k views

Removing .html and index.html from URL

I'm having some problems trying to Remove the .html extension from URLs Removing 'index.html' from an URL 1) To remove the extension I have tried using this in my htaccess file. RewriteEngine on ...
3
votes
1answer
639 views

Redirecting a .co domain to a .co.uk with masking

This is my first post here, so be gentle... A friend wanted a website and paid for one to be set up. For reasons unknown to me he ended up with hissite.co rather than hissite.co.uk, which is what ...
3
votes
1answer
1k views

How do I create a .htaccess file that would make my website work like Adfly

I need, but don't know how to make, an htaccess file that will send a user, when looking for the home page, to index.php. It should not send them anywhere when they look for a URL like /7fg4/. ...
3
votes
1answer
2k views

Extend depth of .htaccess to all subfolders and their children

I need to be able to use .htaccess in all subfolders for full depth. E.g. I have .htaccess in public_html folder: \public_html\.htaccess How I make it to work for the folder small as well? ...
3
votes
1answer
127 views

JS and CSS caching issue: possibly .htaccess related

I've been using the HTML5 Boilerplate for some web projects for a while now and have noticed the following issue cropping up on some sites. My CSS and JS files, when loaded by the browser, are being ...
3
votes
2answers
432 views

RewriteRule not working for certain URLs

There are a few domains pointing towards the same server, and of course I need them all redirect to only one of them. Redirects work, but only for certain URLs. What works: http://www.domain.com, ...
3
votes
2answers
2k views

Share on Facebook does not show thumbnail images

I have a PHP application which has a "Share on Facebook" button that, On the development server shows the thumbnail images correctly and allows the user to select between them On the live server, it ...
3
votes
3answers
777 views

Will googlebot index my index.php even with an htaccess redirect?

Using a redirect statement in my htaccess file, people who type the following into the address bar... http://example.com/index.php ...are redirected to... http://example.com/ I also have a ...
3
votes
1answer
1k views

Clean URLs without PHP file extension

I want to make my URLs clean, for example: http://sample.com/about-me instead of: http://sample.com/about-me.php This is my code: RewriteEngine On RewriteBase / RewriteCond ...
3
votes
1answer
296 views

Blocking pages from being crawled with specific URL encoded parameters

While seeing the Google Webmaster Tools report there are certain URL encoded parameters like %5c and %22 coming up in URL's of site. We tried to identify the issue and observed that due to incorrect ...
3
votes
1answer
143 views

URL not found after rewrite

Using this .htaccess file: Options +FollowSymLinks Options +Indexes RewriteEngine On RewriteRule matches/(.*)-v-(.*) matches/matchevent.php?event=$1%20v%20$2 [R=301,L] This url: ...
3
votes
1answer
1k views

.htaccess and .htpasswd throwing 500 internal server error

I've created a .htaccess and a .htpasswd file, both using my hosting's tool, uploaded them, and I get an error when I try to view the directory. Why? my .htaccess file: AuthName "Restricted Area" ...
3
votes
1answer
767 views

Force fresh content, not from the browser cache

I used the following code in the htaccess to put my site under maintenance and show the visitors maintenance.html. Options +FollowSymlinks RewriteEngine on RewriteCond %{REQUEST_URI} ...
3
votes
2answers
396 views

301 redirect to 404 page?

Currently i'm migrating www. prefix from my urls and use htaccess to do the job. Since we have new software and cleaned database some of the old urls doesnt exists anymore. Therefore some requests ...
3
votes
2answers
235 views

How do sites avoid SEO issues and legalities with subdomain unique ids?

I was looking through a few websites recently and noticed a trend I'm not sure I understand. Sites are creating unique referral URLs for customers in the form of: http://customname.site.com (If ...
3
votes
1answer
211 views

Subdomain In Addon Domain Is Not Working

I added a new addon domain to my cPanel hosting. With the new added addon domain, I try to make some subdomain of it. But, the subdomain is not working like subfolder does. This is my situation: ...
3
votes
1answer
470 views

Proper caching method with .htaccess [duplicate]

Possible Duplicate: .htaccess and browser caching There are a lot of snippets that enable caching on a website and I don't know which one should I use. The most popular is something like ...
3
votes
1answer
608 views

RewriteRule working local but not on remote server

I have a .htaccess file with one simple RewriteRule: RewriteEngine on RewriteRule ^([A-Za-z0-9-]+)$ ?site=$1 I want to have an url like http://www.example.com/imprint and forward it to ...
3
votes
1answer
700 views

Rewrite img and link paths with htaccess and serve the file from rewritten path?

I have a static mockup page, which I want to "customize" by switching a variable used in image-src and link-href attributes. Paths will look like this: <img src="/some/where/VARIABLE/img/1.jpg" ...
3
votes
1answer
1k views

Will adding “www.” to my domain setting in Google Analytics impact already collected data?

I have a profile in Google Analytics (GA) that has been collecting data for a year. The domain setting in GA is "http://example.com". The site, however, will redirect any non-www request, to ...
3
votes
1answer
340 views

Redirecting from a dynamic URL to a prettier/simple URL?

I am trying to redirect a page via my .htaccess, but it does not seem to be working. Old page: /dyn/?q=customer%20reference&f=1,1,1,1,1,1&c=10,10,10,10,10,10&s=1,1,1,1,1,1,1&st=1 New ...
3
votes
1answer
180 views

Looking for a step by step guide to URL re-writing with mod_rewrite and other methods

I'm looking for step by step resource about how to rewrite URLs and have a few specific questions. I've read the documentation on mod_rewrite in Apache, but I still find myself a little lost. If ...
3
votes
2answers
521 views

How do I redirect an English language URL to an Arabic language URL?

I have a link that's currently formatted like this: http://site.com/news/view/1.html I want to it redirect it to: http://site.com/خبر/عنوان-الخبر where خبر is equal to news and عنوان-الخبر is ...
3
votes
1answer
210 views

Site migration and SEO impact

I'd greatly appreciate a response on the following question relating to site migration and SEO impact. Here's some background on how my domain name and site is currently configured: My domain name ...
3
votes
2answers
204 views

Using .htaccess for proper indexing/SEO of timthumb images

I don't know a whole lot about the intricacies of SEO so I was wondering if someone here could provide some insight to this problem. When you use the php script timthumb on a website, it means images ...
3
votes
1answer
1k views

In Joomla In htaccess REQUEST_URI is always returning index.php instead of SEF URL

I have installed joomsef version 3.9.9 with the Joomla 1.5.25. Now I want to set https for some of the section of my site(e.g URI starts with /events/) while wanting rest of all urls on http.I am ...
3
votes
2answers
770 views

Apache RewriteRule not redirecting

I have this in my .htaccess file: RewriteEngine on RewriteRule ^images/chart\.png$ /static/images/chart.png [L,R=301] RewriteRule ^images/artwork/(.+).png /static/artwork/$1.jpg [L,R=301] ...
2
votes
2answers
593 views

How to prevent a specific website from linking to our domain?

We have a landing page which is used only for running an ad campaign. There is a website that has found this link somehow and is linking to it. I've been told by marketing they don't want that website ...
2
votes
3answers
2k views

How to restrict site access to all countries except mine with .htaccess?

I used this tool to download list in ".htaccess allow" format to allow traffic from my country and restrict all others but it's still accessible when visiting from bunch of foreign proxies. I'm ...
2
votes
3answers
123 views

Check for URLs that return my 404 error page

I have made a custom 404 error page called error_404.html In my .htaccess I inserted: ErrorDocument 404 /error_404.html In order to control/correct 404 errors in my website, I would like to know ...
2
votes
2answers
3k views

Use .htaccess to rewrite requests for a PNG as a PHP GET variable

I'm REALLY bad with .htaccess files, and reading through the existing questions on SO only confuse me more (mainly because they're all situation-specific and don't exactly apply to my situation at ...
2
votes
2answers
144 views

Replacing an existing website – SEO considerations for broken links?

I have built a new website to replace a client's existing company website on the same URL. The content is entirely different, and none of the page links are the same. Do I have any issues to worry ...