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 ...
2
votes
1answer
78 views
Why is this mod_rewrite redirecting my domain?
I'm trying to redirect all URLs past the "/" of my domain to an old.mysite.com version, but leave the mysite.com itself alone.
For example, "mysite.com" -> "mysite.com", but "mysite.com/some-url" -> ...
1
vote
1answer
647 views
Apache rewrite rule for all pages after domain name
I asked this question on stackoverflow.com: http://stackoverflow.com/questions/8466321/apache-rewrite-rule-for-all-pages-after-domain-name
Sorry for redirecting, but I wasn't aware of ...
0
votes
1answer
189 views
How to block my images from being displayed by other websites? [duplicate]
Possible Duplicate:
How is anti-hotlinking done?
I have a lot of images on my site and I don`t want to let other people to use my images on their sites. Is there any way to block the use of ...
1
vote
2answers
1k views
apache domain redirect to subfolder
I have a hosting account with godaddy. Its a linux system running apache. The way they do their setup is your primary domain is the root folder. When you add a subdomain its in a subfolder of the ...
0
votes
2answers
626 views
Apache mod_rewrite rule to convert URL of page, keeping parameters same
I sent out a link in an email that had a typo in the URL. I need to make a quick change for tracking purposes so that any incoming hits to the URL are instead parsed to another URL.
From the link ...
3
votes
3answers
196 views
mod rewrite condition !-f being violated
I am using Wolf CMS, which is served by PHP.
I want to redirect /index.html to /index.php.
I put the following in .htaccess:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
...
1
vote
1answer
252 views
mod_rewrite to change parts of a URL causes infinite loop error.
I moved my website to a new CMS and some of my URLs look different now, so I want to delete a part of incoming URLs so that links to my page still work properly.
The old URL looks like:
...
0
votes
1answer
405 views
Verify 2 cookies with mod_rewrite before serving images
I have the following mod_rewrite rule, which works fine in my Apache 2.x on CentOS 6 Linux machine, but is not complete:
RewriteCond %{HTTP_COOKIE} !id
RewriteCond %{REQUEST_URI} ...
0
votes
1answer
573 views
Override .htaccess from parent directory
I have a local LAMP stack (without the MySQL. LAP stack? Anyways..) and I am using this as a development environment for a production website. The site is placed in a sub-directory of the Apache2 ...
2
votes
2answers
1k views
Is it possible to force a directory index to display even if an index file exists?
On my Apache server I need to display a directory index of a given folder even if it already contains an index file that has been defined in DirectoryIndex. In this case an index.html file exists, but ...
0
votes
1answer
169 views
How can I point a subdomain at another server? [duplicate]
Possible Duplicate:
How to point a domain to another subdomain?
Is it possible to set up a subdomain to render content of another server?
Let's say I wanted google.domain.com to render ...
0
votes
2answers
85 views
How to make mod_rewrite work transparently?
Following is the content of .htaccess file
<IfModule mod_rewrite.c>
Options +FollowSymLinks
Options +Indexes
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ...
0
votes
1answer
383 views
.htaccess 301 rewrite rule not working
I had made the page the-book.html in wordpress site, later changed the name to about-the-book, now i have written the .htaccess file as
**RewriteRule ^the-book.html$ ...
1
vote
3answers
1k views
Using env variables with RewriteRule and ErrorDocument
I'm having problems with the following while config. my Apache server to Rewrite some urls.
SetEnv PATH_TO_DIR /directory
RewriteRule ^%{PATH_TO_DIR}/([a-zA-Z0-9_\-]+)/([a-zA-Z0-9_\-\.]+)/?$ ...
2
votes
1answer
81 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?
0
votes
1answer
216 views
Redirect all urls to a subfolder
I have several old, broken urls that looked like this:
http://www.easyjob.net/partners/whatever.html
I would like to redirect them all to http://www.easyjob.net/partners/general/
The following rule ...
0
votes
1answer
250 views
mod_rewrite prevent repeating backreference
I am trying to match a single reference in a URL to pass to a script, while retaining the rest as the path to the script. For example:
#/scripts/paramater/foo/bar.php should call
...
0
votes
1answer
126 views
just another mod_rewrite question
from the url
xxx.yyy.site.com
just need to redirect to
xxx.site.com
Thanks for the help, sorry I have no regex/rewrite foo.
1
vote
2answers
165 views
Google Analytics when 404 handler is used as 'mod_rewrite'?
I'm consulting on a web site which in order to provide clean URL's uses the 404 handler to catch what would otherwise be a 404 and serve the correct content.
In case that's not clear the 404 handler ...
0
votes
1answer
1k views
Mod Rewrite not working
I am trying to get the URL www.mysitedomain.com/blogs/displaynamehere to show what is in the directory at
www.mysitedomain.com/blogs/blog.php$display=displaynamehere
So thanks to the people who ...
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
1answer
125 views
Optimal way to implement very big redirect list in Apache2
I have about 6000 URLs that need to be redirected after changing the CMS. All those URLs are stored in a DB table together with an ID that allows me to tell what is being referenced. Using this table ...
0
votes
2answers
385 views
Apache mod_rewrite for multiple domains to SSL
I'm running a web service that will allow people to create their own "instances" of my application, running under their own domain. These people will create an A record to forward a subdomain of their ...
1
vote
2answers
86 views
url mod_rewrite
I had an e-commerce website hosted on http://mydomain.com/beta for more than a year, eventually I decided to move the website to root http://mydomain.com
I had done quite a lot of link postings to ...
1
vote
1answer
554 views
How do I get mod_rewrite working with typo and wordpress?
I've some trouble with typo3 (mydomain.net) and wordpress (mydomain.net/blog/) using mod_rewrite.
First I was running a typo3 installation which uses mod_rewirte without trouble.
Now I'm trying to ...
3
votes
1answer
312 views
clean urls and differences in hosts
I am developing a relatively static website, where I want to be able to access each page without typing .html (or .htm or .xhtml ...) at the end (/about not /about.html).
I am developing using the ...
1
vote
1answer
34 views
Mod Rewrite change extention of a page
i want to mod rewrite change extension of any page to what i want.
for ex. i want change index.php to index.abc
is it possible with mod rewrite?
4
votes
1answer
726 views
How to internally rewrite a page when requested from specific HTTP_HOST
I have a Drupal site, site.com, and our client has a campaign that they're promoting for which they've bought a new domain name, campaign.com. I'd like it so that a request for campaign.com internally ...
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
1answer
77 views
Issue with permanent redirect implementation
I have a tricky problem related to 301 redirections I badly need help with.
I tried to implement these via .htaccess, but ran into trouble.
The start of my .htaccess looks like this:
SetEnv PHP_VER ...
0
votes
0answers
912 views
Redirect all access requests to a domain and subdomain(s) except from specific IP address? [closed]
This is a self-answered question... After much wrangling I found the magic combination of mod_rewrite rules so I'm posting here.
My scenario is that I have two domains - domain1.com and domain2.com - ...
1
vote
1answer
844 views
URL Rewrite to subdomains?
say i have a website with /article.php?id=1&category=Minecraft&Name=Lorem+Ipsum
and /topic.php?category=Minecraft
how would i setup url rewrite to make the topic pages being
...
1
vote
2answers
134 views
htaccess rewrite problem
Maybe is best way to show my problem in one example.
In my .htaccess :
RewriteRule ^catalog/[a-z0-9_-]+-([0-9]+)/[a-z0-9_-]+-([0-9]+)/[a-z0-9_-]+-([0-9]+)/ ...
1
vote
1answer
164 views
Apache Redirect based on directory name
I'm trying to use one install of Kohana to manage two separate sites rather than just duplicate the install. I have directories like this:
applications/
app1/
app2/
The .htaccess I have ...
0
votes
1answer
96 views
htaccess 301 Redirect with URI
How can I write a .htaccess mod_rewrite rule to redirect all traffic to a specific subfolder to a different subdomain, but include all the trailing URI and url structure and in a SEO friendly way.
...
1
vote
2answers
72 views
Is there something wrong with my .htaccess or is there something wrong server-side?
I'm using the following .htaccess file in one of my subdirectories on my server:
Options +FollowSymlinks
RewriteEngine on
RewriteRule (.*)\.png generate.php?userid=$1
My non-production environment ...
1
vote
1answer
538 views
Mod_rewrite on Amazon S3
Is it possible to use mod_rewrite on Amazon S3?
www.example.com/about.html -> mybucket.s3.amazon.com/index.html
www.example.com/welcome.html -> mybucket.s3.amazon.com/index.html
...
1
vote
1answer
215 views
Kohana with cherokee
How to setup kohana's index.php with cherokee webserver?
Should i add a rule to redirect all to index.php?
These settings don't work
Rule RegExp ^.*index.php.*$
Redirect ^(.*)$ => index.php$1
1
vote
1answer
3k views
How to setup mod_rewrite/htaccess to do url masking and forwarding to a subdirectory?
Its been about three years since I've played with apache and php(I've been using thin and nignx ;). So I've forgotten how to setup a mod_rewrite directive to forward all http requests from root to the ...
1
vote
1answer
227 views
301 Redirect are these URLs equivalent?
I want to redirect an entire duplicate directory to the same files in the directory above the dup_folder.
Redirect Code in .htaccess:
Redirect 301 /dup_folder/ http://www.example.biz/
It redirects ...
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
133 views
mod rewrite help needed to redirect old domain to new domain
I recently switched sites from janeullah.com (which had an A dns entry pointing to janeullah.zenfolio.com) to janeullahphotography.com. I'm on Dreamhost, currently have A record on janeullah.com going ...
0
votes
1answer
233 views
Changing mod_rewrite “file exists” checks to not see directories as files
I have the following mod_rewrite rules set up:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
This works fine, allowing me to ...
0
votes
1answer
185 views
Mod RewriteRule not working on all URL's
this is my .htaccess
Options +FollowSymLinks
RewriteRule ^(.*)wp-content/uploads/(.*) $1watermark.php?src=wp-content/uploads/$2
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
...
3
votes
1answer
102 views
Can I get IIS to treat some .shtml files as .php files?
I want to be able to get IIS to interpret SHTML files (only in a specific directory) as PHP, and interpret the rest as SHTML.
If so, then how?
1
vote
1answer
1k views
mod_rewrite causing too many redirects
The .htaccess we have in our document_root directory is as follows:
RewriteEngine on
RewriteRule ^posts/1/first-post-title$ /posts/1.html [L]
RewriteCond %{REQUEST_URI} ^/posts/1
RewriteCond ...
2
votes
2answers
60 views
I want to redirect anyHOST.anyTLD to www.anyHOST.anyTLD
I'm trying to find a generic enough modrewrite rule that will acomplish following:
Redirect anyHost.anyTld to www.anyHost.anyTld
Not mess with any other subdomains, for examle other.anyHost.anyTLD ...
1
vote
1answer
1k views
Setting Content Type with mod_rewrite
I have the following mod_rewrite rule:
RewriteRule ^/yui-3.3/yui_config.js$ /web/yui/yui_config.js [R]
when looking at the network traffic with Firebug and Chrome I noticed that ...
0
votes
2answers
157 views
Is it possible to mod_rewrite BASED on the existence of a file/directory and uniqueID?
My site currently forces all non www. pages to use www.
Ultimately, I am able to handle all unique subdomains and parse correctly but I am trying to achieve the following:
(ideally with ...
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 ...