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
0 votes
0 answers
14 views

How to change pages URL in PrestaShop

I'm a new PrestaShop user and a need to know how to modify pages URL. This is my website URL to change: https://bitec31.example.com/content/6-prodotti I want to remove "content/" and the ...
Simo_Riz's user avatar
0 votes
0 answers
31 views

SEO Impact: Rewriting image urls in htaccess

I'm currently looking to leverage Cloudflare Image Resizing on a sizeable Wordpress multisite network. Changing all the image requests across the site to reflect the Cloudflare URL is of course going ...
Simon Bennett's user avatar
1 vote
0 answers
23 views

intercept numerical subdomains and rewrite to example.com/?(number)

Is there anyway via .htaccess to rewrite numerical subdomains to /?. For example, 0123.example.com would be handled by example.com/?0123. I want a rewrite rule not a redirect because I want to hide ...
Adam Larsson's user avatar
0 votes
1 answer
53 views

Apache URL rewrite does not mask subdirectories

The admin setup a subdirectory /sites/default/files/resources and updated the docroot .htaccess to point to this subdirectory so that the domain www.example.com points to it. I do not have access to ...
TPI's user avatar
  • 1
-1 votes
1 answer
93 views

htaccess and redirects

I'm wanting my URL to resolve to https://example.com if the visitor is typing in the URL with http://www or http:// or https://www Right now I have a redirect in my htaccess and it works but I get ...
Chris J. Popp's user avatar
6 votes
1 answer
848 views

Do URLs that only consist of an id, for example, a timestamp, have a chance to succeed in SEO?

For example: https://example.com/12345678912/ vs https://example.com/keyword1-some-words/ Is URL still an important factor for Google?
Alireza Dini's user avatar
0 votes
0 answers
185 views

Can't Find a Solution for Removing Trailing Slash at End of Directory URL

Please help me get my URL folders to point to index.php without a slash at the end. I tried this guide, but all I get is a URL with the slash at the end of it. The computer displays the right page, ...
Neo's user avatar
  • 1
0 votes
1 answer
234 views

How to use mod-rewrite for SEO friendly get params?

At present the webpage accepts get params like this https://TripTale.in /details.php?id=AlphaNumericKeys Which I want to make it look like https://TripTale.in /details/someTexts/AlphaNumericKeys ...
Sourav's user avatar
  • 123
2 votes
1 answer
123 views

.htaccess rewrite does not work with adwords gclid passed to the final url

Have a problem with traffic coming from Google Ads. A have a redirect roll that redirects https://example.com/some-words-words-aktivitet/ to https://example.com/index.php?mobile=1 (RewriteRule ^some-...
user3699041's user avatar
3 votes
1 answer
106 views

How to modify $uri to avoid HTTP-Splitting vulnerability

How can I modify below block to overcome HTTP-Splitting vulnerability. There is an official recommendation to instead use $uri_request but unfortunately that doesn't work for below code. location /...
JM John's user avatar
  • 43
2 votes
1 answer
81 views

Redirect 301 a URL already created by a rewrite rule in .htaccess

I'm creating SEO friendly URLs with rewrites in .htaccess. Now I need to redirect (301) a couple of these rewrites, and have no idea how to do that. These lines: Options +FollowSymLinks RewriteEngine ...
Aknot's user avatar
  • 123
17 votes
1 answer
3k views

Same Arabic phrase encoding into two different urls, why? How to handle?

I have a multi-lingual site which two arabic phrases which to my eye (and to the Arabic speakers I've asked) looks the same, but they encode differently. إعادةصياغةالنصتلقائياباللغةالعربيةمجانا ...
Kevin Danikowski's user avatar
4 votes
1 answer
62 views

Will changing URLs with .htaccess impact my SEO negatively?

Basically, I have URL like www.example.com/month/day/name-of-post. What I want to do is to change the month/day to blog/month (or just /blog/) for continuity. I have a WordPress and the pages are ...
Sarian Morio's user avatar
2 votes
1 answer
1k views

Nginx URL rewrite with static .html files for SEO

I'm trying to setup a Nginx configuration for nice URLs without .html extension. What I currently have works, but the / URI redirects to /index and I don't want that. The URL rewrite rules should be ...
Rumplin's user avatar
  • 123
2 votes
1 answer
461 views

How to rewrite a request to different files based on the domain name in ".htaccess"?

I run the website https://www.1.example. The contents of my .htaccess file are as follows: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ \...
Bartosz's user avatar
  • 21
4 votes
1 answer
772 views

Modify rewrite rule to match ONLY directories, NOT directories AND files

I have the following rule in my .htaccess file: RewriteRule ^[^/].*/(dir1|dir2|dir3)(.+) $1$2 [QSA] It works great for the directories except sometimes it conflicts with files. How can I modify this ...
John's user avatar
  • 153
1 vote
1 answer
3k views

IIS Root redirect to subfolder with HTTPS and SSL certification

I need to redirect all HTTP requests to HTTPS with a subdirectory. Currently all requests that go to http://example.org needs to be redirected to https://example.org/subdirectory. As an example: https:...
Chris Wessels's user avatar
1 vote
0 answers
1k views

CDN changes URLs to cdn.example.com

I am testing a CDN. All the website URLs are being changed from www.example.com to cdn.example.com and this will lead to a SEO drop. I have followed the procedure and asked the support service, with ...
user avatar
4 votes
1 answer
578 views

Why rewrite to index.php is not working on a wordpress site?

So my rewriterule is like RewriteRule ^test$ index.php [L] I tested it on https://htaccess.madewithlove.com?share=b0a9904b-1ec4-49cd-917c-36426ff6150a it works fine. I also tested it on live Joomla ...
Wen Shenk's user avatar
  • 505
4 votes
1 answer
180 views

htaccess - URL Rewrite to rewrite specific URLs but allow one subdir URL

We are using a CMS (Magento) where we are looking to have all of the current customer dashboard links redirect to the homepage, however when doing this with simple 301 rewrites, it unfortunately ...
ne0nlight's user avatar
  • 195
2 votes
0 answers
219 views

How to locally serve static website which has human readable urls | How to rewrite urls in a dev server? [closed]

So let's say there are static files - index.html ( / ) - blog -- index.html ( /blog ) -- blog-post.html ( /blog/blog-post ) Question 1: are this urls human readable? Question 2: when people use ssg ...
link2name's user avatar
2 votes
1 answer
595 views

Why is this .htaccess evaluating to 302 redirect instead of internal rewrite?

As an example, I was expecting this https://example.software/credits to evaluate to an internal rewrite https://example.software?mode=credits Why is it showing up on the browser url-bar as a 302 ...
Rohit Gupta's user avatar
  • 2,472
2 votes
1 answer
1k views

How can I rewrite a URL to use a new path for Apache?

How can I rewrite a URL so that following is achieved: example.com/old/index.htm is redirected to example.com/new/index.htm ? I've tried to add the following RewriteRule in my server config vhost to ...
wouter205's user avatar
  • 337
3 votes
1 answer
38 views

We are restructuring some URLs are 301 redirects enough to avoid a massive drop in traffic?

My org is rebuilding a very old, very haphazardly built WordPress site and we are thinking about making some changes to our custom post types and therefore the URL structure will change which is going ...
rugbert's user avatar
  • 131
3 votes
1 answer
709 views

Redirect URL ending in certain `variable=value` query string, to `URL?variable` (i.e., strip `=value`)

I'm trying to create a 301-rewrite for URLs ending with ?amp=1 to nearly the same URL and query string, just stripping the value (=1). Examples: https://example.com/?amp=1 should redirect to https://...
andrewgoma's user avatar
1 vote
1 answer
98 views

Subdomain rewrites without using certs that don't support sub domain affecting

I am using LetsEncrypt to generate and renew my certs for my website. Unfortunately, it does not support subdomains. Having said that, I have a ton of rewrite rules that work fine. For example: ...
user1970839's user avatar
2 votes
0 answers
27 views

Problem with URL path when I applied SEO friendly URL [duplicate]

I was working on PHP project and making SEO friendly URL Like, OLD : http://example.com/list_product?q=men-top-wear New : http://example.com/list_product/men-top-wear Here is my .htaccess file: ...
Pex Bht's user avatar
  • 21
4 votes
1 answer
367 views

Mod Rewrite Multiple Query String

I'm having trouble using modrewrite to redirect a URL with multiple strings. I have a PDF handling script. I want to redirect something like: https://www.example.com/pdfs/samplepdf.pdf/open [or /...
Michael Riordan's user avatar
4 votes
1 answer
928 views

Rewriting a folder name using .htaccess doesn't want to work

I am wondering, why folder renaming doesn't work. RewriteRule ^pl/(.*) public/$1 Let's say I have a URL like: example.com/public/index.html Now I want to rewrite the URL to example.com/pl/index.html ...
Mantykora 7's user avatar
1 vote
1 answer
304 views

Url changing with htaccess

I have a web presentation with some typical url adresses. Now I need to add a rewriterule for a different languages, examples: domain/club -> do not change domain/club/path -> do not change ...
Jimmy Found's user avatar
1 vote
0 answers
36 views

Modify rewrite rule to handle four ids rather than just one [closed]

I have rewrite rule which gives id from link to script and it works perfectly: RewriteRule ^index/viewproduct/id/(\d+)$ produkty/index.php?id=$1 [L] I need one more RewriteRule to handle URLS like: ...
XmanY's user avatar
  • 21
1 vote
1 answer
1k views

.htaccess Rewrite Wordpress Subdirectory without breaking other subdirectories

So I have WordPress installed in /wp/ but I want all WordPress URLs to be rewritten to appear in the root directory. I currently have this working (see below) but I want to change my .htaccess so it ...
Quinnell's user avatar
1 vote
0 answers
249 views

Can a reverse-proxied Facebook in an IFRAME access the other logged-in Facebook's in other windows and IFRAMEs?

We have set up a reverse proxy to Facebook. We wound up another subdomain on our server and pointed it at https://www.facebook.com using the following web.config. (Redacted slightly for security's ...
bugmagnet's user avatar
  • 111
1 vote
2 answers
41 views

Using two domain names in a single folder

I have inherited an English/French static web site. The original developer created it so all the html files are in the root directory of the English domain and added "-fr" to the French file ...
Pennopoly's user avatar
  • 111
1 vote
1 answer
2k views

Rewrite URL with ID to one file using .htaccess

I have "home" directory as: /var/www/page I need redirect: /var/www/page/index/product/id/9098890 Where 9098890 is the id of product. to one file: /var/www/page/script/index.php I want ...
XmanY's user avatar
  • 21
1 vote
1 answer
68 views

Will a .com SSL certificate cover a redirecting .com.ar domain?

we have a website with 2 different domains: www.example.com or example.com and www.example.com.ar or example.com.ar I want all requests redirected to www.example.com. I know I have to create two ...
matiasPandu's user avatar
2 votes
1 answer
2k views

How can I limit .htaccess to current directory scope only?

I have something like this: Options -Indexes RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php?path=$1 [NC,L,QSA] Order deny,allow ...
Kirikan's user avatar
  • 33
2 votes
1 answer
54 views

Can I have separate url in internal navigation of website and Sitemap?

I have not so SEO friendly url structure in my internal navigation of website(some technical challenges) but marked each of the page with SEO friendly canonical(through CMS) and these canonicals are ...
Aman Jagga's user avatar
1 vote
2 answers
79 views

Will /blog/ at the start of the URL path for my WordPress articles help SEO?

I have a WordPress website for a business. And they have many pages, Custom Posts, etc. And they do have a Blog also. At present their blog urls are like this: Main page for blog: example.com/blog ...
Akhilesh B Chandran's user avatar
1 vote
1 answer
183 views

how fix rewrite rule conflict

I am using following rewrite rule and its working fine : 1) RewriteRule ^([^/]*)/?([^/]*)/?([^/]*)/$ estates1.php?pageNum_Clusterb=$3&estname=$1&location=$2 [L] but when add second code in ...
Pardis's user avatar
  • 21
1 vote
2 answers
43 views

How do irrelevant parts of restructured URL affect SEO?

I'm new to SEO and not sure how exactly google crawler works If I use the following format for URL: example.com/category/id/name The content of the page is loaded by only the id part, the other ...
Abhijeet's user avatar
  • 111
1 vote
0 answers
20 views

SEO Rewrite , URI Without .php Extension To file [duplicate]

I have website with this output Link : https://domain1.net/estates.php?estname=XXXX&location=YYYYY I want change it to : https://domain1.net/XXXXX/YYYYY I try it with following rewrite rule : ...
Pardis's user avatar
  • 21
3 votes
1 answer
902 views

301 redirect rewrite query string in .htaccess [duplicate]

I am trying to perform a 301 redirect in .htaccess and I need to remove the query string ?view=full. Here is what I have that is not working: RewriteRule ^/contact/?view=full$ /contact/ [R=301,L] I ...
Guy's user avatar
  • 41
0 votes
0 answers
20 views

Which URL is best [duplicate]

We are in the process of creating landing pages whose contents will be living in the server whose directory houses mylove.example.com. The URL will be mylove.example.com but for marketing purposes, ...
Frances Rosales's user avatar
4 votes
0 answers
58 views

NGINX configuration for the same folder protection rewrites in each of thousands of subdirectories

The following code allows me to protect a specific folder with the membership software we're using. The problem is if we have 1,000 folders we need to protect, we need to copy/paste this same code for ...
Jennifer W's user avatar
0 votes
1 answer
20 views

URL Rewrite - Does order of directories matter to search engines?

So a pretty straight forward question here. Should the directory structure created from url parameters such as: /color-brown/shape-square/material-wood/ remain consistent? Does it matter if you also ...
John's user avatar
  • 103
2 votes
1 answer
2k views

mod-rewrite - sending any URL with ".php/" to 404

I have a substantial number of rewrite rules in place for a variety of reasons such as: disallow indexes, set custom error pages, force non-www, https, strip trailing slash, redirect index.html or....
Raseone's user avatar
  • 61
1 vote
0 answers
117 views

How to use the same base url prefix for category and product pages in Woocommerce?

I checked out this article https://docs.woocommerce.com/document/removing-product-product-category-or-shop-from-the-urls/ which explains that it is not good to remove the product and category bases ...
ClawDuda's user avatar
  • 1,187
2 votes
1 answer
54 views

Can I rewrite to a redirected URL using .htaccess file?

I have a page A. I want to have a page B which is served as a rewrite of page A using .htaccess. Is it possible to redirect page A to page B from .htaccess or is it going to go into an endless loop?
Sojaner's user avatar
  • 23
-1 votes
1 answer
31 views

Aesthetic URL problem: Website from server02 should look like its on a subdirectory of the main site from server01

www.example.com is on server01 with IP address 192.0.2.123 abc.example.com is on server02 with IP address 192.0.2.21 I actually do not want the subdomain abc. Ideally I want it at www.example.com/...
incognito's user avatar

1
2 3 4 5
11