A URL rewrite engine is software that modifies a web URL's appearance (URL rewriting). Rewritten URLs (sometimes known as short, fancy URLs, or search engine friendly - SEF) are used to provide shorter and more relevant-looking links to web pages. The technique adds a degree of separation between ...

learn more… | top users | synonyms (1)

4
votes
2answers
4k views
0
votes
0answers
15 views

how to write a nginx redirect for all subfolders of a /[category-name]/

I have a blog with many categories. Due to some old legacy links, there are mulitple urls that run off these category urls. Examples: site.com/category-one/extra-url/ ...
1
vote
3answers
5k 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 ...
1
vote
2answers
23 views

Force IIS to reload URL Rewrite Rules

I did a change to the URL Rewrite rules to prevent hotlinking to pictures and uploaded the Rules.Config to my site. However, it didn't work so I rolled the change back and reload web.config. ...
3
votes
0answers
40 views

Use of no-index-meta-tag on pretty URLs?

By now I am fighting through the world of SEO and run into a problem, I think. Let's say I have a page like www.example.com/i-am-a-pretty-url, which is re-written by .htaccess from i-am-ugly-url.php ...
2
votes
2answers
2k views

Which method is better to add “www.” before domain name

I have search through Google and found 2 methods to add www before domain name. First is by adding a CNAME and second is using rewrite mod in .htaccess file. I just want to know which method is ...
1
vote
1answer
83 views

How to keep friendly URLs consistent?

I downloaded a site with a crawler script (HTTrack) and now have a few hundred HTML files that need to be edited and re-deployed. The original site ran on a combination of Drupal and a lesser known, ...
0
votes
2answers
41 views

Generate urls for same product with different designs

How do you handle a product url when a brand has the same product type in different shapes? Let me provide you with an example. I have Brand A that has sling bags. There is a sling bag, and there is ...
2
votes
1answer
143 views

“Friendly URLs” rule in .htaccess interfering with some directories

My .htaccess is set up to remove .html from URLs as follows: RewriteEngine on RewriteCond %{http_host} ^example.com [NC] RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,NC] RewriteCond ...
3
votes
1answer
86 views

After rewriting URL page not found

I want to rewrite my current URL that is http://localhost/sitename/landing-page/?from=Algeria&to=Afghanistan&submit=Submit to http://localhost/sitename/removals-from-Algeria-to-Afghanistan ...
4
votes
3answers
250 views

Which is more SEO friendly, redirect or rewrite?

On Apache 2.4, which is better for multiple migrated URLs in terms of SEO, 301 redirect or rewrite? I have ~50 URLs.
1
vote
1answer
47 views

URL Rewrite - remove ?url=

I have an address which is /blog?url=article-1 Is there a way to just remove the ?url= part and replace it with a forward slash? So, in the end, the URL should look like /blog/article-1 I have ...
3
votes
3answers
183 views

Redirect $.html to $/ mod_rewrite rule clash

I have already remapped URL's from for example /sub/test/ to test.html but I also want to redirect /sub/test.html to /sub/test/ but here seems to be a clash between the rules. .htaccess files is in ...
1
vote
1answer
33 views

Where is the URL Rewrite options in IIS 6.2?

I am trying to set a replica of an existing (production!) web site of my new employer on my local machine. By replica I mean: "as close of possible" in terms of versions (IIS, PHP, MySQL, WordPress, ...
5
votes
0answers
67 views

What might be causing my site's pages to load more slowly in these IIS Rewrite Module rules?

I have the following IIS rewrite rules that work exactly as I wish on both my development and live servers within an Orchard CMS website, though when enabled, seriously slow the site's page loads. ...
1
vote
1answer
38 views

Best SEO practice to redirect wrong URLs with mixed langage in it

a bad plugin generated some wrong path that returned 404 errors when switching language on Joomla website. The plugin problem is solved (I removed it), now I just want to redirect this few errors to ...
3
votes
2answers
39 views

Is a real http to htttps rewrite possible or is this always going to be a redirect?

I noticed that there are some articles on the Internet that talk about using the apache mod_rewrite module to rewrite a client to server http connection to https. But rewrite does all the changes ...
1
vote
0answers
21 views

httpcontext.rewritepath -> duplicate meta tag

We have a webpage that handle all car manufacturers. Page is called vehicule.aspx. We have a rewrite method for SEO purpose. We gave all manufacturers a unique URL that redirects to the above page. ...
3
votes
2answers
152 views

Limit access to rewritten uri based on IP address

I'd like to limit access to a Drupal 7 registration page (/user/register) from certain IP addresses. I've tried to set the apache directive, but it's still letting me access it from an IP that isn't ...
2
votes
1answer
48 views

Making friendly URLs without making unfriendly URL accessible to anyone

As many know, one can make a friendly URL with mod_rewrite in their .htaccess file like so: RewriteRule ^category/(.*)$ /somescript.php?category=$1 [L] This works as long as somescript.php is ...
1
vote
1answer
71 views

?cid= and ?pid= pages need to be fixed

We have recently changed the platform and design of our website. Now I am having difficulty with url structure. Main product URL shows something like, /categories.php?cid=9 And internal product URL ...
1
vote
1answer
125 views

Apache 2.2 Not Identifying Safari with HTTP_USER_AGENT

I have a web server that has to meet PCI compliance requirements. Their latest round of policy changes have removed support for Safari, after having removed support for Windows XP based IE clients. ...
0
votes
1answer
41 views

nginx location rewrite: match /{?x}, {y}, {?z}. Remove y

I am trying to run CiviCRM with Drupal 7 in a docker container of my own design. Unfortunately, I am running into a problem where for some unknown reason CiviCRM is outputting resource requests ...
2
votes
0answers
21 views

How to prevent duplicate pages with different URL slugs on my Cold Fusion site?

My programer has made my website in Cold Fusion and the URLs are like http://www.example.com/article.cfm/articleid/12345/seo-keyword-title but the problem is the page opens even if the ...
2
votes
1answer
10 views

Forcing the removal of query string on a rewrite rule

I find I'm the only one coming up with bizarre behavior on my website. Now one of my extremely important links has malfunctioned. This is the RewriteRule I have that malfunctioned: RewriteRule ^m/?$ ...
4
votes
1answer
60 views

How can I redirect all my files on old URLs to new URLs on IIS?

I've been looking and trying out different pieces of code for months to no avail. Most of what I have found is for .htaccess, and not for IIS. I have two scenarios: subdomain1.domain.com to ...
0
votes
0answers
14 views

Using Nginx to rewrite a friendly URL to index.php handler gives 404 error [duplicate]

I apologize because I accidentally posted this question as an unregistered user and cannot comment, so I am posting it again. I am having some issues getting the below to work the way I expect. What ...
4
votes
1answer
288 views

Redirect and removing question mark on URL using htaccess

When I access my site using www.example.com/blog it redirects to example.com/?/blog. How can I remove the question mark, so that the redirection just goes to example.com/blog? My current .htaccess ...
3
votes
1answer
48 views

IIS URL Rewrite - Rewriting subfolders to query strings

I want to redirect any traffic on my website based on the following rule: https://www.example.com/abc -> https://www.example.com/test1.aspx?c=abc https://www.example.com/def -> ...
2
votes
2answers
2k views

301 redirection removes UTM tags from URLs

A page redirects to another page using a 301 redirect in a .htaccess file. If try to access the page from a URL with UTM tagging after redirection, it removes all UTM tagging. Is this normal ...
1
vote
1answer
77 views

Redirect URL to the same page with parameter

I have this url in my blog: http://www.myweb.com/ and would like to change into: http://www.myweb.com/?lang=en all the URl, of course, in the same page = index.php I need to use param lang=en to ...
3
votes
0answers
81 views

Using Nginx to rewrite a friendly URL to index.php handler gives 404 errors

I am having some issues getting the below to work the way I expect. What I am trying to do is take a url like https://example.com/TOPIC/courses/details/143911 but have it sent to php with the ...
3
votes
2answers
64 views

Writing clean urls with .htaccess

Update - Alright thanks everyone for your tests, it really helped. The code is good. My problem was not having absolute "/" links. (Due to moving from public_html folder). Only 2 concerns i have now. ...
0
votes
0answers
57 views

Moving rewrite rules to virtualhost tags instead of directory tags

Currently, I have my rewrite rules in what I believe is in the Directory context. My relevant part of httpd config file is similar to the following: <virtualhost nnn.nnn.nnn.nnn:port> ...
1
vote
2answers
328 views

htaccess rewrite doesn't work

I'm trying to redirect url's in my /joomla/ folder containing "rsform" to the same url but except for /joomla/ /formulieren/. However my tried .htaccess rewrite doesn't work. I tried: RewriteEngine ...
1
vote
1answer
164 views

Rewrite Rule for Manipulating Query parameter - middle value in long Query Value

Trying to achieve Source - https://rrr.rrr.com/us/Product-Family/Products/c/Products/layout?layoutType=false&page=0&grid=true&q=:relevance:DriveType:Flash:ProductFamily:Prd 1 To ...
0
votes
1answer
33 views

Can rewriterules work without carets or dollar signs?

Currently when I remap my friendly to non-friendly URLs on my website, I normally use lines like these in my .htaccess: RewriteEngine On RewriteCond %{ENV:REDIRECT_STATUS} !^$ RewriteRule .* - [L] ...
1
vote
2answers
67 views

URL RewriteRule doesn't work when using WP Database Participants in my WordPress website

I'm using WP Participants Database plugin in a site developed using WordPress and I'm trying to transform: ...
2
votes
2answers
53 views

Use .htaccess to remove a subdirectory from a URL when it in turn has a subdirectory

Could anybody please tell me how to rewrite http://example.com/forum/topic/topic-name to http://example.com/topic/topic-name I do not want to simply rewrite http://example.com/forum to ...
3
votes
1answer
292 views

URL rewrite from www.example.com/subdirectory to example.com/subdirectory

I need a solution for the following problem: I use a CMS and want the backend to only be available at http://example.com/backend and not at http://www.example.com/backend. The rest of the site should ...
3
votes
2answers
276 views

“There is no subdomain here.” error in creating (one/multi)-level sub-domains

Objective: I want to create multilevel sub-domains. For example, I've a domain like "domain.com," and now I want to create some sub-domains for it. It should be noted that what I'm working on it, ...
1
vote
2answers
78 views

.htaccess rewrite with % in query string doesn't work

I am trying to do a rewrite of the site from http://www.example.com/folder/site?data%5Bbranch%5D=xyz to http://www.example2.com/test/ Already tried the query string but facing issues with %. Any ...
2
votes
0answers
107 views

nginx rewrite for an url with parameters

I have two types of URL and want to rewrite it for friendly URL. 1. The first: https://example.com/folder/myfile.php?id=xx&param1=yy I want to rewrite to: ...
2
votes
1answer
60 views

Problem with htaccess rewrite condition

I needed to redirect example.com/var1/var2/var3/... to example.com/index.php?myvars=var1/var2/var3/... This is the code I wrote myself: RewriteEngine On RewriteCond %{REQUEST_URI} !=/index.php ...
4
votes
4answers
3k views

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

I have a main domain (me.com) and I am hosting files for my mom's website (mom.com) in a subdirectory in my public_html folder so that mom.com uses files from me.com/mom. All I want to do is make it ...
0
votes
0answers
13 views

IIS Rewrite to append string?

I'm very new to IIS & IIS Rewrite and am trying to create a rewrite rule that does the following: http://somehostname1 {REDIRECTS TO} http://somehostname1.mydomain.com/abc/test.aspx I've been ...
2
votes
2answers
224 views

What is the IIS equivalent of a rewrite rule that sends all requests to a PHP file?

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 ...
2
votes
1answer
67 views

mod_rewrite change . (dot) to - (hyphen)

I'm moving my site and the URL structure has changed because of the new CMS. The old URLs are similar to /my.products.htm, but on the new site we are changing the URLs to /my-products. Is there a way ...
3
votes
2answers
645 views

Require domain alias to show in browser address bar

Similar to question posted here (but not related to sub directories): .htaccess redirect of domain name alias to main domain but must show up as the alias domain I am trying to direct traffic from an ...
1
vote
1answer
290 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? ...