Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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 ...

2
votes
1answer
19 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 ...
1
vote
1answer
20 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....
1
vote
0answers
21 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 ...
3
votes
1answer
30 views

Multiple rules to rewrite the url

Why both rules don't work together and how can i fix it? Only the first one works... I think that there's a conflict between the two rules, but i did not found a solution yet ?p= is the querystring i ...
0
votes
1answer
34 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 ...
1
vote
1answer
100 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....
2
votes
1answer
74 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 ...
0
votes
1answer
33 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/...
1
vote
0answers
22 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 ...
0
votes
0answers
7 views

Best way to rewrite URL? [duplicate]

Which one of the following URLs has the best influence on SEO? http://example.com/post-ID/ http://example.com/title-of-this-post http://example.com/post-ID/title-of-this-post http://example.com/...
2
votes
1answer
43 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
1answer
41 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 ...
1
vote
1answer
137 views

RewriteCond %{HTTPS} !=on is not working even though RewriteCond %{SERVER_PORT} !^443$ works

I have a requirement to check for non HTTPS URLs in htaccess. My understanding is that RewriteCond %{HTTPS} !=on will match all URLs that are not HTTPS. But upon testing, I find RewriteCond %{HTTPS} !...
1
vote
0answers
23 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
0answers
14 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
1answer
38 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
1answer
54 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 ...
3
votes
1answer
72 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/...
4
votes
2answers
429 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} ...
1
vote
1answer
468 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
0answers
34 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 ...
1
vote
0answers
35 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
1answer
35 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
1answer
170 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 ...
2
votes
1answer
68 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 ...
4
votes
1answer
356 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
0answers
33 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
1answer
141 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
0answers
85 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 ...
1
vote
1answer
39 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
1answer
541 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_-]*...
1
vote
1answer
478 views

Forcing trailing slash at end of “fake” folders

The working codes that I've found here most put a slash in everything. I just need force trailing slash in these "fake dirs" (that are part of my rewriting scheme (only directories)) and keep ...
0
votes
2answers
53 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 ....
6
votes
1answer
509 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 ...
1
vote
1answer
37 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 ...
4
votes
3answers
298 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 ...
3
votes
1answer
190 views

How do I do an htaccess rewrite on an internal URL without Google crawl giving me a soft 404 error?

Here is my issue. I have a rewrite rule in my htaccess like this: RewriteRule ^(news|review|feature|editorial|podcast)/([0-9]+)/(.*)$ /article.php?id=$2 [L] Basically what it does is take in a URL ...
-1
votes
1answer
195 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
1answer
159 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 ...
0
votes
1answer
36 views

Use same domain for two websites, depending on customer IP [closed]

Here's the scenario I want to know if possible and how: Scenario Domain (www.foo.com) at one hosting provider. Two websites, one at www.bar.com and another one at www.biz.com, each at a different ...
0
votes
1answer
51 views

htaccess rewrite url

is it possible to create a 301 redirect for the following URL string: Original URL: http://www.example.com/old/old-directory/blog-post-1.html Desired destination URL: http://www.example.com/new/new-...
3
votes
1answer
92 views

blog/index.php/author/ how to create this kind of a URL for my php page?

WordPress blog URL has this notation. chapter .php there is another path. it is not an actual existing directory on the server. my question is how they do that? can I do something like that on my ...
2
votes
0answers
380 views

How to use .htaccess rewrite rules to remove .php and folders from URLs?

I'm trying to simplify the URLs using rewrite condtions and rules on my local WAMP website. For example I would like to have /ProjetSyntheseFAC/mammiferes instead of /ProjetSyntheseFAC/pages/animaux/...
3
votes
2answers
61 views

How to correctly update a Wordpress URL?

I have a WordPress website which has a lot of very well position URL but unfortunately, they all have the id on the URL instead of a friendly URL. I am working on a new website but I will like to ...
1
vote
1answer
1k views

How do I use URL redirection with reverse proxy?

My requirement is to redirect the URL, which is running on port 80 with reverse proxy. I guess I would have to use URL redirection, reverse proxy together. There is already a web-domain active like : ...
2
votes
2answers
78 views

.htaccess RewriteRule leading to unexpected page

I'm trying to do a simple invisible redirection with .htaccess which almost work. I'd like my main domain name example.com to access the content of the folder example.com/V8/ but keeping only the ...
1
vote
2answers
281 views

Do URL parameters create different URLs from Google's SEO perspective?

I have the following 4 URLs. Are all these the same URL or different URLs from Google's SEO perspective? (Having a different query string makes it another URL?) https://www.example.com/buy-web-...
2
votes
1answer
129 views

URL rewrite problem on IIS7.5

My aim is to create Friendly URLs for a website hosted on IIS 7.5. The site has 3 pages with the following URLs: http://www.example.com/contact.php?langid=1&title=contact http://www.example.com/...
1
vote
3answers
81 views

Will shortening a URL hurt my SEO?

Will I mess up my SEO if I remove a part of my URL, even if it still takes you to the same page? An example is: example.com/services/nc/clt/charlotte-nc/... And I want to take out the "services" ...
2
votes
2answers
4k views

How to remove subdirectory folders from the url using htaccess

I am trying to remove the sub-folders from my site URL. Below is the structure of my folders. I am not sure where to place my .htaccess file and what to have written in it: mysiteroot ...