1
vote
1answer
25 views

Apache URL redirection not working with mod_rewrite

I want to redirect the URL: http://example.com/site to http://example.com/~username/site I have the following in my httpd.conf file: RewriteEngine on RewriteRule ^/site/(.*) /~username/site/$1 ...
0
votes
0answers
17 views

Apache/ISS equivalent

I've always used Apache for all my web development work and I'm struggling to get my head around IIS. I've got an API that re-routes all requests to one particular file: 'api.php', how would I do the ...
0
votes
1answer
25 views

Masking / mapping URL's with .htaccess

I've recently been trying to come up with a way of masking the visible URL in the browser (so not 301 redirecting) and still show the same content as the original URL. Here is the scenario... ...
0
votes
1answer
98 views

URL rewrite to another folder and file for specific requests

I have following directory structure on my local LAMP: www basic app router.php public index.html .htaccess and I can access my index page with localhost/basic/public/ and I am not using ...
1
vote
0answers
25 views

Geolocalization and Redirection

I have a multilanguage website. My project was to add the Geolocalization so base on the country that open the site to redirect in the specific url with the right language. The structure of the ...
2
votes
1answer
63 views

Changing file extensions in URIs - Server Error after Apache upgrade

Please can anyone help to identify flaw or incompatibility in .htaccess code causing server error? In the process of changing over from static to dynamic website, I had to maintain some static files ...
5
votes
2answers
488 views

I am changing my file extensions in URLs, how to keep my good SEO results?

We have a website with good SEO results. For design reasons I have to update the design and I have to change file names from .html to .php. But I keep my domain name! What should I do in order to ...
2
votes
1answer
142 views

Using .htaccess, can you hide the true URL?

So I have a web hotel with 1 main website http://www.myrootsite.com/ and a few websites in subdirectories, in a folder called projects. I have domain names pointing to the subdirectories, but ...
0
votes
1answer
17 views

How can I rewrite to my .htaccess in PHP? [duplicate]

How to rewrite my URL from http://www.mysite.com/listingsecond.php?ID=1 to http://www.mysite.com/listingsecond? How can I rewrite to my .htaccess in PHP to do this?
1
vote
1answer
76 views

What is occurring in this .htaccess file in regards to rewriting to clean URLs?

I have the following code in my .htaccess file, which is working fine and using "pretty" permalinks to reroute everything back to /index.php, and using $_GET values to serve customized content based ...
1
vote
1answer
40 views

Changing www to point to non-www, instead of the opposite, using .htaccess

I'm switching servers and need to change the following RewriteCond and RewriteRule commands in the .htaccess file. Right now I'm pointing domain.com to www.domain.com using: RewriteCond %{HTTP_HOST} ...
0
votes
1answer
84 views

How to secretly rewrite Google Analytics campaign codes to main page?

I want to create a simple "secret" mod_rewrite redirect (not shown in user's browser address box) to redirect: http://www.mydomain.com/code -> ...
1
vote
2answers
454 views

Remove .php and id from URL and replace with slash

I have tried lots of URL rewrite rules in .htaccess but I am stuck now. I have to change this URL: products.php?id=31 to products/31 I have used: Options +FollowSymLinks -MultiViews ...
2
votes
1answer
92 views

Apache rewrite rule to add a directory in front of a file

I have an HTML page in my root directory, and when someone clicks it I'd like there to be a directory before the file name, that doesn't exist. For example, instead of just being able to access: ...
1
vote
1answer
91 views

Rewrite URLs not working - wrong method or conflict?

I've been at this for about an hour now and I'm not having much luck. htaccess files are quite new to me, so I'm obviously doing something very wrong. Current htaccess content, which I need to keep: ...
0
votes
1answer
74 views

URL rewrite from www.domain.com/sudirectory to http://domain.com/subdirectory

I need a solution for the following problem: I use a CMS and want the backend only be available at http://domain.com/backend and not at http://www.domain.com/backend. How do I have to change my ...
1
vote
1answer
110 views

Rewrite rule for friendly URLs to index.php is not working from htaccess

Trying to get SEO Friendly URLs to work for my website using the following htaccess: RewriteBase / RewriteCond %{REQUEST_FILENAME} !-l RewriteCond %{REQUEST_FILENAME} !-f RewriteCond ...
3
votes
1answer
156 views

Redirect www to non-www using Apache htaccess does not work

I have this in my .htaccess (modified from the default Drupal .htaccess): RewriteCond %{HTTP_HOST} ^www\.website.com\.com$ [NC] RewriteRule ^(.*)$ http://website.com/$1 [L,R=301] In theory this ...
1
vote
2answers
115 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 ...
0
votes
2answers
162 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 ...
0
votes
2answers
199 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
0answers
70 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
0answers
55 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$ ...
1
vote
1answer
54 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
1answer
152 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
3k views

how to rewrite %20 in .htaccess

I need to perform an equivalent rewrite to: RewriteRule ^/this%20file.pdf http://www.example.com/ How do I handle the %20? I have tried RewriteRule ^/this\%20file.pdf http://www.example.com/ ...
2
votes
1answer
113 views

Rewrite catalog/index.php to www.domain.co.uk [closed]

We have an online shop with a welcome page. Our SEO company has asked us to get rid of the welcome page with a rewrite. I am struggling to get this to work. Can you help please? I want to rewrite ...
1
vote
2answers
237 views

How do I redirect www and non but not IP

I am trying to redirect www.domain.com or domain.com to www.domain.com/temp.html I am using the following code: RewriteCond %{HTTP_HOST} ^.*$ RewriteRule ^/?$ ...
3
votes
1answer
606 views

Wild card redirect in htaccess giving error this webpage has a redirect loop

In my website I changed the directory name "vehicles-cars" to "vehicles-cars-for-sale". When I tried to redirect using a wild card redirect from my old directory name to new directory name in my web ...
0
votes
1answer
74 views

rewrite url for articles with htaccess

I've had a look through several other questions to see if i could get this working but have had no success at all at the moment so i'm hoping someone can help. This is the url i currently have, ...
2
votes
2answers
906 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 ...
2
votes
1answer
423 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 ...
3
votes
1answer
270 views

Dynamically rewrite URLs upon the user's selection - is it possible?

In my PHP based web application, there's a form that generates a URL according to the user's selection. The form has 7 different fields, each one of them affects the final URL, none of them is ...
5
votes
3answers
15k 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
2answers
684 views

URL rewrite subfolder to root and forbid accessing subfolder

I have Drupal installed in a subfolder drupal but I want to access pages as it is in root folder: http://www.example.com instead of http://www.example.com/drupal I'm able to have this working, but ...
3
votes
1answer
165 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 ...
4
votes
2answers
2k views

URL rewriting removing question mark and replace it with slash

How can I rewrite my URL from edit.php?id=2 to edit/id/2?
0
votes
2answers
2k views

.htaccess rewrite www to non-www and remove .html

I need rewrite rules to redirect the following: http://www. to http:// /file.html to /file I've tried using a combination of these but each time it results in a redirect loop on one of the ...
2
votes
0answers
110 views

Rewrite rule not matching second level directory URL [closed]

I have this .htaccess in a po_systems folder of my website # Set up mod_rewrite RewriteEngine on RewriteRule ^build_system/([^/]+)/([^/]+)/?$ ...
-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 ...
1
vote
2answers
48 views

rewrite url (redirection)

How to rewrite url: www.domain.com domain.com to www.domain.com/sell.html Were sell.html is already rewritten I need some kind of redirection.
3
votes
1answer
437 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
1k 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
140 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
54 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 /my.products.htm on the new site we are changing the URLs to this /my-products is their a way ...
3
votes
4answers
2k views

How to create .htaccess to block access to a subdirectory that hosts a separate domain

So I am pretty noob at with creating code in .htaccess, but I know it is what I need to accomplish a pretty simple task. So here is what I want to do. I have a main domain, (me.com), and I am hosting ...
0
votes
1answer
258 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? ...
0
votes
2answers
577 views

.htaccess rules to rewrite URLs to front end page?

I am adding a new application to my site at example.com/app. I want views at that URL to always open myapp.php. E.g. example.com/app -> example.com/app/myapp.php and example.com/app/ -> ...
1
vote
2answers
2k 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 ...
3
votes
2answers
5k 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 ...