Tagged Questions
0
votes
0answers
15 views
Move a website to subdomain while preserving (rewriting) URLs
I'm considering to move the (Confluence) wiki content of www.site.com to the subdomain wiki.site.com to make room for a well-designed landing page (Wordpress) which should take the wiki's place on ...
1
vote
1answer
23 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 ...
0
votes
0answers
33 views
URL rewrite with mod_rewrite
I have rewrite rule in parent directory which rewrites URL:
From example.com/index.php?id=test&cat=category
To example.com/index?test&cat=category
Here is my .htaccess file:
Options ...
1
vote
2answers
137 views
Have UserDir enabled but also want to rewrite url if called differently
I am setting up a new server for our users to use have have personal webspace on. I have in my httpd.conf of apache the directives for UserDir as follows
UserDir disabled root
UserDir public_html
...
1
vote
0answers
61 views
Apache Rewrite to folder no longer working after server upgrade [closed]
The following were both working perfectly for the last 2 years but after a server upgrade the first, with an extra folder is no longer working:
RewriteCond %{HTTP_HOST} ^www\.mayoaccommodation\.com$ ...
2
votes
0answers
242 views
RewriteBase has to change when using UserDir
I have setup our Apache server to use UserDir
This mean our urls are:
http://dev.server.com/~username/drupal/html/
Before our URLS were:
http://dev.server.com/drupal/html/
In the 2nd case I ...
0
votes
2answers
43 views
mod_rewrite issue, won't work when links contain “-”
I've been looking into mod_rewrite for my simple PHP CMS for a couple of days now and I found a rule that was supposed to work for me:
RewriteRule ^(\w+)/?$ view_post.php?url=$1
This is supposed to ...
1
vote
2answers
263 views
“File does not exist” in apache error log when mod_rewrite is using
I am getting below error in server log, when re-writing the urls.
[Fri Jan 25 11:32:57 2013] [error] [client ***IP***] File does not exist: ...
2
votes
1answer
102 views
mod rewrite doesn't work when i added multiple domains
i have redhat linux server and i was using /var/www/html to display my site.
By using the following directive rewrite mod was working fine.
<IfModule mod_rewrite.c>
# Enable mod_rewrite ...
1
vote
2answers
132 views
How to setup up .htaccess rewrites for http and https on the same site?
Im having some issues with htaccess rewrites i need to redirect different parts of my site to https rather than http, for example login and news sections. Im not sure how to go about doing this in the ...
2
votes
1answer
117 views
Internal CDN and setting up subdomain to increase maximum parallel connections
I've heard that browsers can have around maximum of 6 parallel connections per domain at a time.
So I decided to have another subdomain "cdn." then use mod_rewrite to point to media folder then ...
2
votes
1answer
107 views
how to fix .htaccess - redirect http://408.111.1111.domain.us/ to http://domain.us/index.php?w=408.111.1111
We want to use mod_rewrite and .htaccess to do a redirect. How do we redirect http://408.111.1111.domain.us/ and www.408.111.1111.domain.us/ to http://domain.us/index.php?w=408.111.1111 ? If the ...
1
vote
1answer
1k views
Enable 'mod_rewrite' Using .htaccess File On cPanel Shared Hosting Server
I'm using cPanel to host my website. I need to enable 'mod_rewrite' on this Shared Hosting cPanel account to run my script. I've tried to Google the solutions high and low but did not find any luck ...
1
vote
1answer
185 views
Using mod_speling with multi-level htaccess and rewriterules
We recently switched formats for managing our 301s. For the most part, everything went well, but it seems to have stopped mod_speling from working properly. Here's what we changed:
old ...
2
votes
1answer
155 views
Apache rewrite rule that matches a specific query string
I need to rewrite a specific wordpress url to a 404 error:
?page_id=15 => 404
How can I match the query string? Apparently Apache doesn't feed that to the rewrite mod...
3
votes
1answer
328 views
Disallow all user agents except one using .htaccess?
I've been struggling to get this .htaccess working. The aim is to disallow all user agents besides my app. The app sends a GET request with a user agent of lets say 'AcmeUpdater'.
Whenever I try to ...
0
votes
1answer
130 views
How to silently auto-load from a subdirectory, but allow internal paths to think the file is located at site root?
I have files in my site root, and also files in its "Iternet_IE" directory. I need to:
1.) be able to call/include other files (e.g. headers or footers) from within files at either of those ...
2
votes
2answers
285 views
getting 500 intenal error when setting 301 redirect using .htaccess
I am trying to use a 301 redirect to direct users and bots to my new site but when I put the .htaccess live i keep getting a 500 internal error shown.
The site is actually a subdomain which i want ...
0
votes
2answers
265 views
help redirecting IP address
Google has indexed the IP address of my site rather than the domain, so now I'm trying to set up a 301 redirect that will redirect the IP address and all subsequent pages to the domain.
I currently ...
2
votes
1answer
38 views
Finding out what features of regular expressions are supported by mod_rewrite in Apache 1.3?
Is there a particular regular expression engine that is used by mod_rewrite on Apache 1.3?
I want to know so I can get a list of supported and non-supported features.
1
vote
2answers
259 views
WordPress mod_rewrite redirect specific folders
As a new user, I'm not allowed to post more than two hyperlinks here. So I have added a space after every http (ignore them and read as full URLs).
System: Debian Etch, Apache 2.2
I have a WordPress ...
2
votes
2answers
167 views
How can I test for a URLs existeance before redirecting to it?
I am using Apache's mod_rewrite to redirect mobile users to my mobile site based on their http_user_agent. However not all pages have a mobile equivalent. Also mobile pages end in .html and "full" ...
2
votes
2answers
634 views
apache rewriting url doesn't work(using godaddy hosting)
I'm using a framework to create my website(codeigniter) by default the urls are like this:mysite.com/index.php?/etc/etc/etc.
And I'm trying to remove the index.php?, I tried to remove it by doing ...
0
votes
1answer
425 views
mod_rewrite problems - redirect subdomain to different domain
I must have a brain freeze as I can not get my rewrite rules working.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^otherdomain\.example\.com [NC]
RewriteRule ^(.*) http://www.otherdomain.com/ ...
2
votes
1answer
295 views
Htaccess - Rewrite png to php file
I currently use trans.png.php?id=1&campaign=test to track my newsletter campaigns.
I want to use trans.png instead as it's the src of an img tag.
How can i do this in htaccess? Also is there any ...
4
votes
1answer
2k views
How to write a generic .htaccess file rule, regarding RewriteBase
The following rule in my .htaccess works just fine for routing calls to index.php:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
However, this does not ...
2
votes
2answers
208 views
Apache HTTP redirect from a URL list
One of my web applications will be completely replaced by a new system. All URLs will change and thus external links would break. I want to setup Apache httpd to answer with proper 301-redirects to ...
1
vote
1answer
520 views
When is the leading slash (/) needed in mod_rewrite patterns?
Here is an example from the Apache documentation for enforcing canonical hostnames:
RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^/?(.*) ...
2
votes
1answer
106 views
Is it possible to check the case on Apache redirects or aliases?
I have a big website (15,000 pages) with a log list of redirects (about 800) that have been used in marketing pieces for years. My Apache server has been running mod_rewrite for the past 10 years or ...
1
vote
1answer
948 views
Apache rewrite to 404 except for matched query
I'm trying to handle logically simple operation, but apache rewrite does not handle my website's query strings requests. I heard it's does not do it eventually. Still cannot understand it's regex ...
0
votes
1answer
191 views
htaccess - “detect” url and redirect
Idea is:
if URL = "http:/localhost/site/"
else if URL = "http:/localhost/site"
redirect to
"http:/localhost/site/index.html"
Can this be done with .htaccess / Apache mod_rewrite and how?
0
votes
2answers
926 views
.htaccess rule not working without HTTP redirect [R]
I am using the following .htaccess with Wordpress to remove index.php from the visible URL. This works but forces an http redirect so the URL changes in the browser window. If I remove the [R] it no ...
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 ...
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
649 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 ...
5
votes
1answer
4k views
How to pass GET parameters to rewritten URL?
I have an .htaccess rewrite rule like this:
RewriteCond %{SCRIPT_FILENME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^search/(.*)$ search.php?q=$1
What this does is, if someone visits ...
3
votes
1answer
134 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 ...
1
vote
2answers
536 views
getting mod_rewrite to work on Mac OS X
I'm trying to get mod rewrite to work on my Mac. This is the content of the .htaccess file:
<Files *\.ini>
order allow,deny
deny from all
</Files>
RewriteEngine on
RewriteRule .* ...
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 ...
1
vote
2answers
166 views
Rewrite Issue on index.html
I have index.html on my html_directory on my website also I entered a rule as follows:
RewriteRule ^index.html$ newindex.php
It seems requests to my site is routing to my index.html file , my ...
0
votes
1answer
220 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
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
votes
2answers
2k views
Having trouble redirecting old product sites and categories to new pages
I recently upgraded a shopsystem to prestashop and imported the previous products (~1200), and I managed to keep the old category_id and product_id. I'm trying to set up those 2 rules to redirect all ...
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
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 ...
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?
0
votes
1answer
116 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
78 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 ...
