mod_rewrite is a URL rewriting module for the Apache web server. It is commonly used for so-called "pretty" URLs because of its ability to redirect on the server side (transparent to clients and their browsers), but also provides the power and flexibility to perform various request handling tasks ...

learn more… | top users | synonyms

2
votes
1answer
562 views

Apache htaccess results in files being downloaded instead of displayed

So I had this "beautiful" website that did exactly what I wanted it to do. Then I shut down my PC, reboot and...the pages just download now instead of being displayed. I re-installed XAMPP and ...
1
vote
2answers
139 views

Rewrite using .htaccess results in too many redirects

I'm currently creating a webpage which requires rewrites to look nice. The URL is: u.{my_site}/get.php?fid={ID}. The URL entered should be: u.{my_site}/{ID}. Because I'm bad (and new) at rewrite ...
2
votes
3answers
145 views

Does purposely linking to an invalid URL and then using 301 affect SEO?

On a section of my site, I am currently using .htaccess rewrites to put the ID as part of the URL instead of in the query, like so: RewriteRule ^([a-z_]+)?/?tours/([0-9]+)/(.*) ...
0
votes
2answers
83 views

The number of soft 404 errors is increasing because of redirects to the home page

I have an increase in soft 404 errors. Using Apache in my .htaccess file I have: Redirect 301 /test.html‎ /page/pop/test Redirect 301 /about.html‎ /about I have also tried: Redirect 301 ...
1
vote
1answer
85 views

Would phpBB break if I move it from one folder to another? Can I use mod_rewrite to redirect requests for that forum from old folder to new one?

Please note that I have installed dynamic web pages (PHP) in the directory *public_html/old/* in order to create the web site www.example.com. Actually I have created a PHPBB forum and thus the URL of ...
0
votes
1answer
257 views

Using Apache's rewrite module to set up local host names for development

I have several websites on my development machine under Apache's htdocs folder. Apache Directory root is htdocs, but I want to be able to access each different site there by individual domain names. ...
1
vote
2answers
2k views

.htaccess language redirects with SEO-friendly URLs

How do I setup my .htaccess file to detect several languages, and redirect them to specific SEO-friendly URLs? Basically every URL needs to go to index.php?lang=(...). So, for English language ...
1
vote
1answer
335 views

.htaccess rewrite wildcard folder paths from host

My desired result is change a file to root / from a N number of paths. For example: www.host.com/a/b/c/e/f/g/images/1.jpg, where A~G is not always given. Result: www.host.com/images/1.jpg. This is ...
1
vote
1answer
159 views

What's wrong with my mod rewrite for GEOIP based on location?

I'm a bit of a newb in modrewrite but used it successfully on my server before. I successful installed the module on my apache server and tested out with PHP test page(it correctly returned my area ...
0
votes
0answers
50 views

Configuring dnsmasq to properly work with mod_rewrite on Mac OS X Mountain Lion

I read an article on the echoditto blog and followed the recommendations for setting up dnsmasq on my mac using homebrew. Now I am having an issue I cannot resolve, and I need help, because it has ...
2
votes
1answer
91 views

GeoIP and Mod_rewrite: Should I use latitude or city/town?

My boss wants to change our site to one domain with different sub domains being redirected by location to appropriate business site location. Issue is, these locations are only 100+ miles away from ...
1
vote
1answer
81 views

.htaccess problems with redirection

I apologize ahead of time that this might be a common question, however I've spent 3-4 hours already on solutions which don't quite fix the problem. I have a site and it is moving to a different ...
1
vote
2answers
77 views

“pretty urls” with only JavaScript content changing

I have a small webapp that uses a single HTML file, but accepts any URL in the directory. I'm using mod_rewrite to make all of these send index.html. The index page may be accessed at, for example, ...
2
votes
2answers
1k views

Mod-rewrite rule broken after host upgrade to Apache 2.4

I use the following code on my site to remove php extension from links: RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond ...
0
votes
0answers
91 views

Clean URL using index files or mod_rewrite

Is it better to make clean URL's using index files in directories or simply using mod_rewrite rules to remove the file extensions?
1
vote
1answer
173 views

Mod rewrite is not working or doing anything

So I've used an online .htaccess editor and it's not working for some reason on my test server, here's the content of my .htaccess file. RewriteEngine On RewriteRule ^Page/([^/]*)/$ /?Page=$1 [L] I ...
1
vote
2answers
120 views

One .htaccess file with rewrite rules for all domains

Our server is configured with multiple domains which reside in subfolders of the public_html folder. So domain1.com is located in /home/user/public_html/domain1.com and domain2.com is located in ...
1
vote
2answers
23 views

Setting up mod rewrite

I spent hours in finding how to make my url pretty but no luck. I am hosted in DreamHost and using php under fcgi. I'm triying to make my: ...
2
votes
1answer
465 views

mod_rewrite doesn't work at all

I have my small website (made for study purposes) on localhost and I am trying to get .htaccess working (note that I am a complete beginner to .htaccess). So far, I have discovered that .htaccess is ...
1
vote
0answers
177 views

Is my .htaccess rule creating an infinite loop?

Whenever I type a made up address that includes a directory index it removes it. The problem is when the the address includes a forbidden subdirectory. It reduces itself until it hits forbidden. How ...
0
votes
2answers
149 views

Redirecting non existing post to homepage; is that good for SEO? [duplicate]

I am checking my website out on Google Webmasters and I am seeing an astonishing 5000 links that could not be found by Google's Crawlers. That's normal, because my website is built in a manner that ...
0
votes
2answers
178 views

To Fix HTTP 400-499 error codes with 301 redirects in .htaccess file

This issue is on Wordpress site. I am aware we can change the URL naming convention in WP but i have changed my url format from date format to simple postname followed by slug as shown below. old ...
2
votes
1answer
105 views

Go up one directory in mod_rewrite

I've got a standard Zend Framework 1 project that looks a bit like this: Project |- public |- .htaccess |- index.php The .htaccess looks like this: RewriteEngine On RewriteBase / RewriteRule ...
1
vote
1answer
115 views

mod_rewrite with .htaccess to make dynamic page search engine friendly

I am trying to make search engine friendly pages with .htaccess. The page look like /en/hotel.php?id=nice-hotel-7-patterson-street and I would like the page to look like this ...
3
votes
1answer
142 views

Standard Wordpress mod_rewrite rules interacting with one of my own rules are causing all requests for a certain page to be sent to the homepage

I have WordPress 3.5.1 installed on Ubuntu 12.04 LTS. I'm running Apache 2.2.22. NOTE: I can't share the domain that I'm working on, and must santize any config files and log outputs. While the ...
2
votes
1answer
667 views

Redirecting one page to HTTPS, and all others back to HTTP isn't working as expected

I have WordPress 3.5.1 installed on Ubuntu 12.04 LTS. I'm running Apache 2.2.22. NOTE: I can't share the domain that I'm working on, and must santize any config files. While the website is public, ...
1
vote
1answer
169 views

Getting the masked URL values in Mediawiki

I have successfully masked the URL in Mediawiki. By using the following scripts in .htaccess and localsettings.php files in Mediawiki, i.e.: .htaccess: Options +FollowSymLinks RewriteEngine on ...
0
votes
2answers
255 views

Pretending a file is in subdirectory with .htaccess

I have a web application, and it has a RESTful PHP backend that uses Zend framework (which does its own URL rewriting magic). The problem is, my backend's entry-page is api.php and the endpoints look ...
0
votes
2answers
665 views

SEO on multilanguage website URL

I'm setting up a multilanguage website and I would like to have your help to take the best decision as regard SEO. After reading this. I would like to change my URLs from this form ...
1
vote
1answer
218 views

Google Analytics shows visits to pages redirected in .htaccess

Yesterday, I switched on a section of pages in our site that replaces a really old collection of pages. In our .htaccess file, I have rules that redirect a request for any page in the old section to ...
1
vote
2answers
1k views

How do I redirect a URL using rewrite in .htaccess that has a question mark and forward slash where page.html is the variable?

Hello and thanks to all who contribute to this seemingly mind boggling puzzle. I apologize in advance if .htaccess questions belong on server fault. So I have to move a domain to our hosting servers, ...
3
votes
1answer
120 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: ...
1
vote
1answer
188 views

Silent redirection not working with mod_rewrite

I'm trying to grasp apache mod_rewrite When I add this to my .htaccess it silently (url doesnt change) shows page bob.htm RewriteEngine on RewriteRule index.htm bob.htm I.e. If I type this in the ...
2
votes
1answer
64 views

Simple RewriteRule [duplicate]

I'm trying to write a RewriteRule to make a simple url. I want users to be able to type enter www.example.com/somepage and have it take them to www.example.com/abc/somepage.php How can this be ...
1
vote
0answers
58 views

optimize htaccess

I have two condition which are conflict RewriteRule ^patients/findadoctor/(.*)\.html$ subcategorydoctor.php?id=$1 [L,NC] and RewriteRule ^patients/findadoctor/(.*)\.html$ ...
3
votes
1answer
350 views

RewriteRule for URLs with spaces

My site's pages are in multiple languages whereby each language version shares its media (images) with the other language versions. I place all versions and the media in a single directory with the ...
1
vote
1answer
56 views

Redirecting previous domain subfolder links

I've recently bought a domain that was unregistered. After looking in Google webmaster tools, Google is trying to crawl random pages that don't exist. Turns out it did have a previous owner. The ...
1
vote
0answers
158 views

Mapping different users to folders with mod_rewrite

I'm setting up a DAV server with Apache 2.2 and would like, if at all possible, to be able to redirect a user to their own folder without having per-user URLs, if at all possible. So I point a user ...
0
votes
1answer
163 views

Rewritten URLs stopped getting indexed a month ago

I'm working on a website for someone which sells their products on their web site. There is an item.php page which displays the item for sale. I switched all item pages/inks from dynamic URLs to ...
2
votes
1answer
87 views

.htaccess redirect with mod_rewrite

I moved my wiki from http://jklatex.square7.de/wiki/doku.php/start to http://logicpuzzle.square7.de/start and now i want to redirect the URL with mod_rewrite. My .htaccess is as follows: # BEGIN ...
0
votes
2answers
223 views

Issue with Apache redirection [duplicate]

I want to redirect mysite.com or http://mysite.com or www.mysite.com or any other format given my user to http://www.mysite.com, I'm able to achieve this by rewriting following lines in my .htaccess ...
0
votes
1answer
113 views

Capitals in URL subdirectory not changed by htaccess

Within my WordPress website I am redirecting sub directories to internal and external links. Now, when you place a CAPITAL letter in the sub dir it does not work anymore and the website does not show ...
2
votes
2answers
47 views

Need to remove www for only one sub directory from a domain

I have a domain like www.example.com. I need to remove www. from specified sub folder by using a .htaccess file. Example : www.example.com/blog should redirect to example.com All other sub ...
3
votes
3answers
475 views

SEO Joomla URL to WordPress URL's

I am trying to migrate from Joomla 1.5 SEF URL's to WordPress SEF URL's. The old links use this formatting: /site/sectionname/categoryname/id-titlename.html I want to migrate it to ...
1
vote
1answer
321 views

Don't $_GET value on link rewrite with .htaccess

I config enable htaccess on my server (i enable mod_rewrite and do like this: http://stackoverflow.com/questions/11064005/enable-htacess-error-on-ubuntu-12-04-with-apache2) But on localhost is run ...
3
votes
1answer
228 views

Remove dynamic generated end of URL

I have a Joomla 2.5 website with joomshopping and AceSEF extension component. SEF URL generation works just fine except one issue. For some reason, there are dynamic parts generated in the end of ...
0
votes
1answer
65 views

Redirection transparent to Google and other SE [duplicate]

I am not experienced technical person, and still learning but will try to explain what I have done so far and what my query is. I have a (hypothetical) domain az-studios.com On that domain I have 3 ...
1
vote
1answer
34 views

Trouble reading htaccess canonicalization

I just took over development of a site and am having trouble figuring out the canonicalization rewrite rules (not my forte). I've pasted the code below. The first bit seems straight-forward enough, ...
2
votes
1answer
352 views

How do I map a (keyword rich) domain name to an existing website?

I am not experienced technical person, and still learning but will try to explain what I have done so far and what my query is. I have a (hypothetical) domain az-studios.com On that domain I have 3 ...
0
votes
0answers
216 views

How to allow a Subdirectory to work and stop redirecting?

I run Drupal on a webserver in the root www directory. I have added another application in a www subdirectory (Piwik). When I try to navigate to the subdirectory app, I get this error message "The ...