Questions tagged [url-rewriting]

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 the files used to generate a web page and the URL that is presented to the world.

Filter by
Sorted by
Tagged with
1
vote
1answer
32 views

How to redirect old parameter based content without jeopardizing SEO

We have a large scale ecommerce site that has pretty high PageRank and tops google results in a few keywords, the current issue is that we have revamped our search which now uses SEO friendly urls to ...
1
vote
0answers
142 views

Create unique IDs between URL with nginx [closed]

I searched and tried nearly two weeks but don't get any useful result, so I'm trying my luck here before I get crazy: Every existing domain should get an unique ID right after the domain. The ID ...
2
votes
2answers
416 views

which component handle php's GET parameters in a URL

In a webserver, which component handles the translation of URL parameters to the $_GET global variable? Is that a module in PHP engine, or a module of the web server (Apache, Nginx)? I'm asking ...
6
votes
1answer
6k views

How to bulk redirect URLs and replace one path segment?

I have several URLs in a WordPress website I would like to rewrite and then make a 301 redirect. URLs are of the form www.example.com/prodotto/something-after These URLs should be changed to www....
1
vote
1answer
729 views

Rewrite URL with multiple queries

This article describes how to direct incoming traffic coming from "fake" URLs of this type: http://www.example.com/seo-sample/article-install-apache-on-linux.php to a PHP file that "really" uses ...
3
votes
1answer
2k views

Set Alias path using .htaccess

I have a path like this http://host.ip/nl/producten-en-diensten/abonnementen-met-gsm which will retrieve the correct content and I also want to receive the same content when I access the below URL ...
3
votes
1answer
144 views

Is this literal or code in the .htaccess file?

Background: Recently, a business acquaintance contacted me because of strange behavior on his website. As may be expected, I found that the site was compromised. One of the signs of the compromise ...
6
votes
2answers
7k views

Have Apache show 404 at missing page URL instead of redirecting to error page URL

Assuming non-existent-page.html does not exist, and the user is trying to access that page and triggered a 404 error. Can i show the requested page URL: http://www.example.com/non-existent-page.html ...
1
vote
1answer
97 views

Modify existing htaccess rewrites to not match particular URLs

Trying to rewrite only particular URL's, for example:- (1) I want to rewrite:- http://www.example.com/keyword-1 http://www.example.com/keyword-1/sub-keyword http://www.example.com/keyword-1/?p=50 (...
1
vote
2answers
1k views

Most seamless way to direct around port 80 and autoredirect to https with Apache

I'm working with a home server and my ISP blocks port 80. I have DD-WRT set up on my router so that I can redirect other open ports (like 443 and 8080) to the server. I also have dynamic DNS set up on ...
2
votes
0answers
604 views

Nginx request map and redirect have no effect

I want to rewrite/return request to new one I have: map map $request $new_request { include url_rmap.conf; } file url_rmap.conf # here i have tried all variations $scheme://d.dom https://...
2
votes
1answer
2k views

How to remove .jsp extension and replace with forward Slash in htaccess?

I want to remove the .jsp extension from my URL and replace it with a forward slash eg. example.com/xyz.jsp to example.com/xyz/ and example.com/xyz.jsp?ab=12 to example.com/xyz/?ab=12. I used: ...
3
votes
1answer
429 views

Htaccess redirect a page with a query string hosted on a temporary IP address?

I have a site that was temporarily set up as 111.222.333.444/~mysite because the real URL was not ready. 111.222.333.444/~mysite/?page_id=123 was a valid page on that site. My site is live now. I no ...
1
vote
1answer
65 views

non-www URL goes to www-homepage instead of that particular page

Let's say my domain is www.example.com. if I type in example.com it goes to www.example.com - which is fine. But the problem is if I type in example.com/jamie/ it still goes to www.example.com - the ...
3
votes
1answer
78 views

Why does apache redirect to www without RewriteRule

So I have a webserver running on Apache, with a few virtual hosts. I want to default to https and hence I have a rewrite rule. <VirtualHost *:80> ServerName example.com ...
3
votes
2answers
875 views

Using an alias on my domain. How do I tell Google that I want it to only index the alias to avoid duplicate content?

I am starting a music blog at www.domain1.com. That URL is an alias shared with www.domain2.com which is just a domain I happen to have hosting with but is unused. In the future I may want to develop ...
1
vote
1answer
8k views

.htaccess redirect without changing url in users' address bar

My website redirects to /temp when visiting the root, I'd like it to appear as the root, without the /temp in the URL address bar. I have a simple .htaccess: Options +FollowSymlinks RewriteEngine On ...
0
votes
1answer
138 views

Multiple Websites with Multiple Sitemaps under single IIS Endpoint

We have multiple websites with different domains under single IIS endpoint. Each website has its own sitemap - sitemap1.xml and sitemap2.xml. Can we implement rewrite rules so that www.example1.com/...
3
votes
1answer
1k views

Rewrite and hide page ID from URL

I am working with the following on a football website and when a user clicks an event they get the following URL format: /live/1/event-name.html Currently the number in the URL represents the ID ...
1
vote
2answers
4k 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. ...
5
votes
1answer
353 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 ...
4
votes
3answers
773 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
3k 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, ...
3
votes
3answers
1k 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 ...
4
votes
1answer
771 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
75 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
81 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 ...
2
votes
0answers
45 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. ...
1
vote
1answer
2k 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
1answer
134 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 (seo-keyword-...
2
votes
1answer
169 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
690 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 ...
1
vote
1answer
1k 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 -> https://www.example....
1
vote
1answer
849 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 ...
5
votes
0answers
525 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 URI ...
3
votes
2answers
403 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. ...
2
votes
1answer
975 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
1k 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 http://...
3
votes
1answer
2k 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: https://example.com/folder/myfile/xx/...
2
votes
2answers
1k 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 ...
1
vote
1answer
746 views

Do a redirect in IIS, but show the original pretty url?

The following case: A visitor comes in on http://www.example.com/pretty. This gets redirected to http://www.example.com/?ID=ugly. This part works. However, we'd like the visitor to keep seeing http:/...
1
vote
1answer
790 views

IIS URL rewrite rules not matching

I have this URL www.example.com/music/in/chicago And none of the rewrite rules in placed in my rewriteRules.config below match the above URL....what am I missing? <rules> <clear /> <...
0
votes
1answer
22 views

Is a blank really a directory when dealing with mod-rewrite?

I spent about 20 minutes wrapping my head around this, and finally came to a solution but did not know why it worked. The important lines (as it relates to this question) in the apache configuration ...
0
votes
2answers
53 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 ...
1
vote
1answer
574 views

Use .htaccess to convert user ID's to usernames? [closed]

I want to use .htaccess to convert the urls that link to profile pages from an ID number to a name. For example, on Facebook, if you were to go to: https://facebook.com/profile.php?id=4 It would ...
3
votes
1answer
599 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 ...
2
votes
0answers
1k views

IIS URL Rewrite Wildcards

I have some URLs as follows http://localhost/wordpress/latest/joe/12 http://localhost/wordpress/latest/bloggs/14 http://localhost/wordpress/latest/thing/15 I would like to redirect them to http://...
1
vote
1answer
492 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
0answers
561 views

URL masking to subdomain redirecting to subdomain

I am trying to change the URL of a Joomla site in browser my original URL is like example.com/marketsite/abc and I want to change it to abc.example.com/marketsite/abc I am using following code in ...
1
vote
1answer
47 views

After mod_rewrite the internal URLs are duplicated many times when crawling

I'm sure it is my mistake in mod_rewrite rules, but I can't seem to figure it out. I've set up the rules for my new site and all works perfect, unless - I try to create a sitemap. The URLs get ...