mod-rewrite

[Apache] Creating rewrite rules for multiple urls in the same folder (solved)

I have been asked by our client to convert a site we created into SEO friendly url format. I've managed to crack a small way into this, but have hit a problem with having the same urls in the same folder. I am trying to rewrite the following urls, /review/index.php?cid=intercasino /review/submit.php?cid=intercasino /review/index.php?c...

RedirectMatch 301 for just html file

Hey All. I need to do a mass 301 Redirect for all pages ending with .html for my site. I am looking to move all the old .html files to a sub-folder ir. RedirectMatch 301 (.*)\.html$ http://www.domain.com/folder/$1.html When I add this and refresh the browser I get a ton of folder/folder/folder now after the url ie domain.com/folder/...

how do i use htaccess to make http requests work properly

I currently have css and javascript file calls (amongst other things) like the following: href="/css/default.css" src="/js/ui_control.js" putting the preceding / in to make the files relative to the root. This works great when my page is in the root of the domain. However, I'm currently in the middle of transferring my site to a new h...

Apache rewrite request using a different forward proxy

Hi, I would like to forward a request in Apache, based on a request header, to a different forward proxy. I think the best would be to use mod_rewrite, but it can use only a reverse proxy defined in the same apache configuration. I also checked the ProxyRemote property of mod_proxy but it can't be used based on conditions, only based o...

Rewriting a number based URL using .htaccess RewriteRule

How can I rewrite a simple number based URL to a sub folder? I want http://mysite.com/123 to redirect to http://mysite.com/en/123. The number could be anything from 1 - 9999. My attempt in htaccess was: RewriteRule ^([0-9]+)$ /en/$1/ [R] But that doesn't work. ...

Rewrite URL in PHP with mod_rewrite

The web server is Apache. I want to rewrite URL so a user won't know the actual directory. For example: The original URL: www.mydomainname.com/en/piecework/piecework.php?piecework_id=11 Expected URL: piecework.mydomainname.com/en/11 How to achieve it with mod_rewrite? ...

Apache .htaccess: ErrorDocument and RewriteEngine not working together

Please take a look at the following .htaccess ErrorDocument 404 /404/ RewriteEngine On RewriteRule (.*) index.php [L] With this setup, I am using header('HTTP/1.1 404 Not Found'); in PHP to redirect to the error handling page and send the appropriate HTTP status code. The correct 404 status code is sent, but the browser shows a blank...

.htaccess rewrite outputs undesired content. I think??

I am trying to rewrite a URL using .htaccess. I am running on Apache version 2.2.15. Contents of .htaccess: RewriteEngine on RewriteRule cars/(.*) cars/member_page.php?user=$1 RewriteRule cars/(.*)/ cars/member_page.php?user=$1 Contents of member_page.php: <?php echo $_GET[user]; ?> URL entered into browser: http://www.mydomain.c...

rewrite rule to switch to subfolder

I'm deploying a Wordpress blog, but I don't want to overwrite the current site yet. public_html/. <-- the current site public_html/wp/. <-- the new site How must my .htaccess look like so I can seamlessly switch from the current site to the new one so that http://domain.tld shows the new site like it would be directly in the public_ht...

URL rewriting with mod_rewrite

The web server is Apache. I want to rewrite URL so a user won't know the actual directory. For example: The original URL: www.mydomainname.com/en/piecework/piecework.php?piecework_id=11 Expected URL: piecework.mydomainname.com/en/11 I added the following statements in .htaccess: RewriteCond %{HTTP_HOST} ^(?!www)([^.]+)\.myd...

How to replace all equal signs with forward slashes using htaccess

Is it possible to remove all instances of the "=" sign and replace it with the "/" sign. Using htaccess? ...

htaccess rewrite directory

I moved my website from the /v1/etc... directory to the /v2/etc... directory and would like to make a permanent redirect in htaccess. Can someone help me? ...

Wordpress htaccess problem

I have some problem with my .htaccess file. Here I am adding my problem. Please help me. My actual URL is as follows http://localhost/buydualit/?searchitem=toaster&amp;pagenum=1 here by using my .htaccess am rewrited my URL as http://localhost/buydualit/toaster-1/ My URL rewriting rule is like follows: RewriteRule ^[A-Za-z-0-9,\"'-\/]...

From mod_rewrite to isapi_rewrite

Hi, I have a Modx htaccess file which needs to be rewritten from mod_rewrite to isapi_rewrite 2. Can someone please help me? The following lines need to be changed for isapi_rewrite 2: Options +FollowSymlinks RewriteEngine On RewriteBase / RewriteCond %{HTTP_USER_AGENT} ^.internal\ dummy\ connection.$ [NC] RewriteRule .* - [F,L] Rew...

distinquish which urls to serve by ssl

Hi all, I want to use mod_rewrite to ensure that certain pages are served with SSL and all others normally, but I am having trouble getting it to work This works (redirect to SSL when request uri is for users or cart) So, requesting http://host.tld/users/what/ever redirects to https://secure.host.tld/users/what/ever RewriteCond %{SERV...

How do I do this simple 301 redirect from index.htm to root?

I've read various reference sites on redirection, and to be honest I understand very little. I currently have standard WordPress mod_rewrite redirect rules in my .htaccess: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /in...

exclude the folders - url rewrite in htaccess

rewriteCond %{REQUEST_URI} ^(ajax|css|functions|image_viewer|images|img|include|fancybox|jquery|jscript|json)$ - [L] RewriteRule ^(.[^/])/(.[^/])/(.+[^/]) ?program=$1&usertype=$2&username=$3 [NC] could you please help me find what is wrong in this.. ? I need to exclude some folders from url rewriting. i tried with the solution given h...

Mod rewrite with 3 parameters ?

Hello, I did tons of methods to figure out how to make this mod rewrite but O was completly unsuccessful. I want a .htaccess code that rewrite in the following method: /apple/upcoming/2 → /handler.php?topic=apple&orderby=upcoming&page=2 This is easy to do, but the problem is that all parameters are not required so the link has diffe...

newbie trying to write url rewite in .htaccess file

My site was under example.com/waha/. Now I move the site right under the root example.com. I want to 301 redirect all the old links like example.com/waha/notice/5803 to example.com/notice/5803. How can I do it? My current .htaccess file is below. <IfModule mod_rewrite.c> RewriteEngine On # NOTE: change this to your actual Statu...

Does redirecting from http://domain.com to http://www.domain.com Avoids Duplicate Content On Google?

Hi, I heared that if i don't redirect the user from http://domain.com to http://www.domain.com it will causes duplicate content of my website on google & other search engines, is that happening? and What is the Mod rewrite Syntax to do it through .htaccess ? Thanks ...