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 ...
0
votes
1answer
46 views
mod_rewrite change . to -
I'm moving my site and the URL structure has changed because of the new CMS. The urls would be similar to http://www.example.com/my.products.htm on the new site we are changing the URLs to this ...
2
votes
2answers
883 views
How can I redirect everything but the index as 410?
Our site shut down and we need to give a 410 redirect to the users. We have a small one-page replacement site set up in the same domain and a custom 410 error page. We'd like to have it so that all ...
0
votes
1answer
217 views
How to block access to a sub-site with mod_rewrite?
Let's say I have the sites siteA.com and siteB.com. They are hosted such that siteB.com actually points to siteA.com/siteB.
How can I block someone from visiting siteA.com/siteB using mod_rewrite?
...
1
vote
2answers
96 views
rewrite on urls to add “/”
I know how to rewrite urls to redirect to a page.
When the "/" is not at the end of www.DomainName.com/user/myUserName the redirect works:
RewriteRule /$ /user/index.php
When I write RewriteBase / ...
1
vote
1answer
215 views
Regex Needed to allow mod-rewrite rule to work either with or without trailing slash?
Given the following rewrite rule:
RewriteRule ^user/([^/]*)$ /userprofile.php?user=$1 [L]
How can I have it work either with or without a trailing slash?
Bonus points, how can I verify ([^/]*) ...
3
votes
2answers
4k views
Rewrite for robots.txt and favicon.ico
I have setup some rules in which subdomains (my users) will default to where I have located the robots.txt, favicon.ico, and crossdomain.xml
therefore if a user creates a site say
...
0
votes
2answers
80 views
RewriteRules targeting a directory result in a gratuitous redirect
I have a standard CMS-like RewriteRule set up in my .htaccess:
RewriteRule ^(.+)$ index.php?slug=$1
Let's say I have a directory called "foo" in the root directory. For some reason, if you hit the ...
2
votes
2answers
414 views
Redirecting a CSS file based on .htaccess rules
I'm trying to hack the css files on OSTicket by replacing them with my own custom ones when a specific URL is accessed. The URL that is accessed for this example is ...
2
votes
2answers
95 views
Virtual hosting
I want to use domains like xxx.abc.domain.tld.
The xxx is my folder to access. I tried it with the rewrite rules, but I can't get it working, because I don't know how to get the part xxx from the ...
-1
votes
4answers
146 views
Hosting plans that allow more then 1 GB for mysql and easier mod_rewrites? [duplicate]
Possible Duplicate:
How to find web hosting that meets my requirements?
I'm using godaddy and am thinking of moving to another hosting company that allows easier mod_rewrites and a bigger ...
1
vote
1answer
55 views
Simple mod_rewrite Question
I want to have everything that looks like this:
/1/2/3/4/5/[...]
to redirect to this:
/index.php?u=/1/2/3/4/5/[...]
unless the requested string is a specific file. So anything that doesn't have a ...
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 (.*) ...
4
votes
1answer
4k views
Properly force SSL with .htaccess, no double authentication
I'm trying to force SSL with .htaccess on a shared host. This means there I only have access to .htaccess and not the vhosts config. I know you can put a rule in the VirtualHost config file to force ...
1
vote
1answer
830 views
Using mod_rewrite to send all requests to a certain document
I want to temporarily redirect all requests for a site to index.html, using apache only. Is this mod_rewrite approach going to work, and is it the right way to do it?
RewriteEngine on
RewriteRule ...
0
votes
1answer
481 views
Rewrite URL to a PHP script with parameters
I'm trying to create a service that you give it a URL like http://myhost.com/34.png and it will return the result of the script http://myhost.com/create_image.php?count=34.
I know this is possible ...