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
2 answers
2k views

How do I force a www subdomain on both HTTPS and HTTP?

For whatever reason I can’t seem to get this right. I’ve looked at many examples on here and on the Apache website. I’m trying to force www.example.com instead of example.com on both HTTP and HTTPS, ...
3 votes
1 answer
6k views

IIS URL Rewrite: Pattern starting with forward slash never matches

I am using IIS URL Rewrite and this one has stumped me. I am redirecting a URL with specific subfolder to a new URL. e.g. https://myapp.example.com/customsite1 redirected to https://newsite1-myapp....
2 votes
1 answer
572 views

Rewrite rule not taking effect

I need to place a rewrite rule in my .htaccess file so that requests for http://example.com/jbossas/jboss-configuration are redirected to: http://example.com/jboss-server/jboss-configuration So I ...
2 votes
0 answers
157 views

Infinite redirect loop with IIS 8.5 Drupal

After configuring my website, i stuck in a infinite redirect loop. I have 6 domains, example.com is main domain. example1.com, ..., example5.com are forwarding to example.com. Doesn't matter which ...
0 votes
1 answer
259 views

SEO: Is a redirect without using 301 but a PHP script, OK?

I've been reading about redirection, and how it can affect (or not if done properly) SEO. I'm changing my website's content platform from Drupal to a PHP custom made code. In my current site I have ...
2 votes
4 answers
28k views

How do I do URL re-writes on Plesk?

I am very new to URL re-writing and I am using Plesk which is window-based web server, hence I can't use Apache's mod_Rewrite. Can anyone tell me what is the proper procedure for this?
2 votes
1 answer
1k views

NGINX - Rewrite version number in JS file name to parameter for PHP

I had a rewrite from file.js?c=123 to file.js.php?c=123 but query params were downgrading my SEO evaluation. Actually, some proxy CDN do not cache query params. server { location ~ \startscript....
0 votes
1 answer
186 views

Nginx url rewrites for changed shop categories

We recently moved from Magento 1 to 2, during the move we cleaned up our category urls to be more consistent. For instance we changed: /mens/mens-accessories/mens-wallets to : /mens/accessories/...
3 votes
1 answer
1k views

NGINX - Rewrite .js.php file to .js

I have a dynamically created file start.js.php?c=21 and I would like to rewrite it's extension (to start.js, with query params). Is that possible? Is that a good method having such a rewrite? Is ...
3 votes
2 answers
522 views

How can I rewrite an old URL using variables to a static html page?

I am trying to redirect old URLS to the new URLS, the old site used variables in the URL but the new site uses SEO friendly URLs. When I try to redirect the old URL, it is not redirecting correctly ...
4 votes
1 answer
212 views

Why is www. working but no-www is not?

Right now my site runs on http://www.example.com but I need to run that without www also i.e example.com Can some body tell me here that how can i do that?
1 vote
0 answers
199 views

nginx rewrite rule not applied (using contao cms)

I am trying to make a redirect for https://mypage.com/foo to https://mypage.com/bar while still keeping https://mypage.com/foo in the browser url. I have tried several combinations of different ...
6 votes
7 answers
18k views

How do you remove invalid characters when creating a friendly url (ie how do you create a slug)?

Say I have this webpage: http://ww.xyz.com/Product.aspx?CategoryId=1 If the name of CategoryId=1 is "Dogs" I would like to convert the URL into something like this: http://ww.xyz.com/Products/Dogs ...
2 votes
1 answer
266 views

How would you write an http to https redirect rule for web.config on IIS8 that would go directly to preferred domain with www.?

I have a site that we just setup with SSL and have a redirect rule set up in web.config. We also use the www. as the preferred domain. The problem I have is I want to skip the middle step in the ...
1 vote
1 answer
52 views

Why hide .NET URL extensions and make them appear to be .html?

I'm new to the web engineering and I have done some searching for URL/Domain masking. In my company, my HOD asked one question during meeting and wants the answer in the next meeting. He asked that ...
4 votes
3 answers
793 views

Rewrite to SEO friendly URLs for language negotiation with type-map files on plain html files using .htaccess

When visiting the website www.example.com/ the visitor should be redirected to the correct language version, e.g. www.example.com/en for english and www.example.com/es for spanish. My current ...
8 votes
5 answers
12k views

WWW.example.com or HTTP://example.com – which one is futureproof?

http://example.com www.example.com http://www.example.com example.com Which of these would you choose as your favourite to work with from 2016 onward? Which domain name would you mention to your ...
1 vote
0 answers
63 views

Error in SEO Friendly URL [closed]

I have below url structure http://example.com/blog.php?blogURL=user-already-has-more-than-max_user_connections-active-connections and I want to below http://example.com/blog/user-already-has-more-...
1 vote
0 answers
25 views

How do I access the wp-admin interface of a site that lives inside a joomla folder, using IP address / siteground server URL?

For historical reasons, we have several sites that live inside the public_html folder of a different site (all hosted on sitegrounds). To complicate things up, the root domain has a name that is the ...
1 vote
1 answer
286 views

www subdomain cannot be in subdirectory, how to organize files on server?

I have just switched hosting providers and stumbled across a limitation that bugs me. Previously I had the following mapping between domains and files on the webserver: example.com → /web/...
1 vote
2 answers
1k 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. ...
2 votes
1 answer
93 views

Apache rewrite existing rewritten url [closed]

I know how to create rewrite rules in Apache but what I don't know is how to rewrite a previously rewritten url. This is an old URL /boats-for-sale/fairline-squadron-55/1280 and I need to redirect ...
6 votes
3 answers
16k views

Properly force SSL with .htaccess, no double authentication

I am trying to force SSL with .htaccess on a shared host. This means there I only have access to .htaccess and not the main VirtualHost configuration. I know you can put a rule in the VirtualHost ...
3 votes
1 answer
566 views

HTTPS redirect, exclude script parameters from URL

My goals: 1. http://example.com/page/index.php -> https://example.com/page/ 2. http://example.com/page/ -> https://example.com/page/ 3. http://www.example.com/page/ -> https://example.com/...
6 votes
1 answer
2k views

Rewrite wildcard subdomains in .htaccess to corresponding folders on the main domain while preserving the subdomain

I'm trying to rewrite a subdomain to a folder/file like this: name.example.com -> example.com/profile/name foo.example.com -> example.com/profile/foo xyzzy.example.com -> example.com/profile/xyzzy ...
3 votes
1 answer
4k views

IIS HTTP/S rewrite with SSL offloading non-standard local port

I posted this in a different forum and got nothing, so I'm a bit desperate. Here is my scenario: IIS running sites on 80 and 443 - external.foo.com and https://external.foo.com On the same node, a ...
1 vote
1 answer
14k views

.htaccess URL rewriting friendly URL with 2 parameters, the second parameter is optional

I'm kind of stuck at this part and was hoping that I'd get some assistance. I'm building a highscores page in PHP, that's going great, it works. However, I dislike the idea of index.php?skill=name and ...
4 votes
2 answers
10k views

How to force ssl and www for a subdomain as an independent domain?

I have own the example.tld . I want to force SSL and https for root-domain and all of its subdomains. I have used below code in .htaccess file of root-domain: RewriteEngine On RewriteCond %{HTTPS} ...
0 votes
1 answer
2k views

How to take off .html from example.com/page.html

I am using cPanel to build a website and I am not sure how to take the .html or .php file extension off my webpages. Usually I will use a python framework and I do the routing manually but I am not ...
4 votes
2 answers
710 views

Which URL format is better? example.com/[id]/title OR example.com/title/[id].html [duplicate]

Possible Duplicate: SEO : urls : best place for the id My site uses URL rewriting in both formats (for different things), but I'm wondering which one is the better approach? http://www.example....
1 vote
1 answer
2k 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
0 answers
67 views

What's the best practice URL Path with multiple occurences of the same parameter?

Case User searches on a website for "cake" and filters the results via two categories: "united states" and "germany". Researched best practices SEO relevant and as short as possible URL if possible ...
4 votes
1 answer
1k views

Nginx rewrite problem - displaying same page with or without .php extension after rewrite

I have implemented the following Nginx code: location / { try_files $uri $uri.php $uri/ @extensionless-php; index index.html index.htm index.php; } location ~ \.php$ { try_files $uri =...
1 vote
0 answers
61 views

Remove non-existent language directory from URLs under nginx

I've got URLs like this: /lang/path-to-file.ext and I want to remove the "lang" because it doesn't exist: /path-to-file.ext How do I do that on an nginx server?
2 votes
1 answer
244 views

Redirecting from one page to another page on my website causes 404 error after using .htaccess file

Currently I'm working on a PHP blog. Where I have used an .htaccess file to get a clean URL, here is the code: RewriteEngine On RewriteCond %{HTTPS} !=off RewriteCond %{HTTP_HOST} ^example\.com$ ...
4 votes
1 answer
1k views

How to use rewrite rule to create exception rule for https redirection for directory ./well-known

Here is my situation: Server A: support.example.com -> port 80 is forwarded to this server Server B: hr.example.com Both are running apache2. For server B I want to use Let's encrypt. I want to ...
7 votes
4 answers
16k views

How to Remove Extensions From, and Force the Trailing Slash at the End of URLs?

Example of current file structure: example.com/foo.php example.com/bar.html example.com/directory/ example.com/directory/foo.php example.com/directory/bar.html example.com/cgi-bin/directory/...
3 votes
1 answer
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/...
1 vote
1 answer
72 views

dynamics urls - redirects or rewrite and page SERP position

I'm trying to get my head on this, our site have thousands of links, is an e-commerce site, where products titles require changes on regular basis to get the best of SEO... you know, as usual, we ...
2 votes
1 answer
102 views

Googlebot URLencoding longtail URLs which is causing server errors

My Google search traffic has been growing consistently for months without any hiccups. Then a few days ago, Google dropped my traffic by about 80% in one day. The traffic would then later rebound ...
2 votes
0 answers
46 views

If I link to clean URLs based on the page title but redirect to URLS with ids as part of a site migration, is that bad for SEO?

I'm importing stuff from a Drupal site that has a couple of alias URLs: /node/123 /my-alias-node-title My new site is a very simple CMS handmade in PHP by me as a practice. In the new system, the ...
3 votes
1 answer
726 views

Possible to match special characters with mod_alias and `Redirect` directive?

I’m using Apache 2.4.6 with mod_alias and have a website which is receiving traffic from a link on another website that I have no control over. The other site’s link is poorly formed and it causes ...
1 vote
0 answers
786 views

Method to redirect website subfolder to new website in IIS

We currently have a website, let's call it https://supersystem.example.com We also offer customized versions of the website to clients, in the past we would throw those custom files into a sub3folder ...
0 votes
2 answers
4k views

Apache .htaccess: Is it possible to write an if condition for a cookie value check?

I want to write an if condition in an .htaccess file to check whether a cookie value is set. Example code: <If "%{HTTP_COOKIE} == 'cookiename and value'"> ... </If>
1 vote
1 answer
79 views

.htaccess Rewrite whole dir contents to another

I am trying to rewrite the whole contents of a directory to the home url. so, if someone visits www.example.com/bnn27sh32j@d299/gold it should take them to www.example.com/gold I have tried: ...
1 vote
1 answer
2k views

How to keep question mark in URL rewriting with a GET method?

I am trying to use URL rewriting to rewrite search-en.php?q=abc to pages-afficher-recherche.php?lang_abbreviation=en&q=abc and I did RewriteRule ^search-([a-zA-Z]{2})\.php\?q\=([a-zA-Z0-9_-]*...
0 votes
2 answers
403 views

How to redirect website with SSL (HTTPS) to without SSL (HTTP)?

I have a WordPress site on a domain that used to be HTTPS, example domain https://example.com. I now want to remove HTTPS temporarily. How do I do that? I have tried to add the following to my ....
9 votes
2 answers
15k views

In a URI, what does the suffix ".do" stand for?

I see URI ending in ".do" on some enterprise websites. I've always been curious to know what that stands for, but my Google searches have so far not turned up an answer. Here is an example from ATT ...
-1 votes
1 answer
511 views

In IIS 7.5, how do you redirect an HTTPS domain to the canonical domain?

So I have a site configured with example.com:80 and www.example.com:80, as well as a certificate for port 443. When a user goes to the www.example.com:80 or 443, which has the SSL certificate ...
0 votes
1 answer
2k views

How to redirect port 80 on server A to 443 server B

I'm wondering how can use my server A to redirect different URL's to the respective server. Here is my setup: Server A: apache 2.4 on ubuntu 16 Server B: apache 2.4 on windows 2012 Port 80 is ...

1 2
3
4 5
11