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 ...
5
votes
3answers
9k views
How to remove trailing slashes from URL with .htaccess?
The situation
Across the entire domain, we'd like the URLs to hide file extensions and remove trailing slashes, independent of the domain name itself (as in, works on any domain).
Sample of our ...
1
vote
1answer
123 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 ...
5
votes
5answers
5k views
How to Remove Extensions From, and Force the Trailing Slash at the End of URLs?
Example of current file structure:
example.com/foo.php
example.com/bar.html
example.com/directory/
example.com/directory/foo.php
example.com/directory/bar.html
...
3
votes
1answer
109 views
redirect non-www to www while preserving protocol
I am aware of the fact that there are tons of questions in this section and in server fault dealing with re-directions from non-www to www URLs. But I couldn't find one dealing with this issue while ...
4
votes
5answers
9k views
“File does not exist” in apache error log
This is an example of an error in out log file:
File does not exist: /var/www/website/female, referer: http://www.website.com/female/dresses/A-Dress-Black
"/female" doesn't exist, because we use ...
3
votes
1answer
963 views
mod_rewrite rule for wildcard subdomains?
Sorry if this has been covered, I can't find anything on this specifically.
I have wildcard subdomains on (*.mysite.com) I need a mod_rewrite expression for this rewrite:
bob.mysite.com => ...
0
votes
1answer
115 views
Switch to https
I'm looking to use an .htaccess file to use mod_rewrite to switch the protocol from http:// to https:// when someone hits my website.
For instance, once someone goes to:
http://www.mywebsite.com/
...
2
votes
3answers
114 views
How to make parameters look more attractive
I'm making a blog site and instead of the users blogs being called /blog?display=username I would like it to just be a sub domain such as mysite.com/username
How would I be able to make the first ...
2
votes
3answers
221 views
How to use .htaccess to show smarter URLs
I'd like to ask how can I call the page www.domain.com/index.php?page=somepage and make the browser show the user in the URL bar the address www.domain.com/somepage/? How do I do that trick?
0
votes
1answer
354 views
Force www. on multi domain site and retain http or https
I am using CakePHP which already contains an .htaccess file that looks like:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) ...