Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

3
votes
2answers
326 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
65 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
43 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
56 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
785 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
93 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
563 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
355 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
146 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
672 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
623 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
758 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
291 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
128 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
923 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
655 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
390 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
232 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
204 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
463 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
581 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
673 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
330 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
176 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
483 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
1k views

Can I enable GZIP on Godaddy?

One of my sites lives on GoDaddy's bottom-of-the-line cheap hosting, I have the correct code in my .htaccess file, but it's not compressing because mod_deflate is not loaded. How do I enable that? ...
3
votes
1answer
186 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
195 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
766 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
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
98 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
2k 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
142 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 ...
2
votes
3answers
590 views

How to remove /index.html

How to make redirect /index.html -> / in Apache? Redirect /index.html http://domain-name.com/ Is causeing infinite loop when opening home page.
2
votes
3answers
2k views

.htaccess - if the file doesn't exist, rewrite to index.php but send 404 instead of 200

I have a catchall .htaccess directive like this: RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !-f RewriteRule ^(.*)$ index.php [L] Anything that doesn't exist and the URL is ...
2
votes
1answer
89 views

What's the “^” in RewriteRule Statements?

I keep seeing the ^ character in RewriteRule statements in a context that doesn't fit with the usage specified here. For example: RewriteRule ^(.*)$ $1.php [L,QSA] What does it signify?
2
votes
1answer
1k views

Multilingual and SEO URLs - best practice?

What would you recommend as a URL structure for setting up a multilingual site when optimizing for SEO? I'm thinking: www.yoursite.com/en/some-category/some-article/ ...
2
votes
3answers
2k views

mod_rewrite works within directory not on root

I am having a problem with my RewriteRule for the querystring portion. What I am able to debug is that the rule is being triggered at least because the page "tags.php" is being rendered but without ...
2
votes
3answers
471 views

Displaying a “coming soon” image to users whilst I work on website redevelopment [duplicate]

Possible Duplicate: 301 redirects for all except me I've been developing a new version of my website for a while now, on a different directory to my currently-live website. Shortly I'll be ...