27 votes
Accepted

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

The difference comes from normalization. I know nothing about Arabic language but if I use both strings in a Unicode viewer, the difference starts right at the left part of the string. First string is ...
Patrick Mevzek's user avatar
6 votes
Accepted

Which is more SEO friendly, redirect or rewrite?

It generally makes little difference. A 301 redirect may cause a short term drop in ranking, but nothing to worry about. An internal rewrite keeps the same URLs. You just need to be careful that you ...
Quentin's user avatar
  • 1,608
4 votes
Accepted

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

Apache server can be configured to show the error page at the error URL, or it can redirect to the error page. It is almost better to show the error page directly at the URL rather than redirecting ...
Stephen Ostermiller's user avatar
4 votes
Accepted

rewrite url - remove trailing / if any and add .php

I assume you want to remove the trailing slash (if any) with an external redirect in order to canonicalise the URL and then append the .php extension with an internal rewrite (ie. hidden from the user)...
MrWhite's user avatar
  • 42.8k
4 votes
Accepted

Enabling Multiviews is how you make a web server able to open links with missing extensions?

tl;dr Yes, you can enable MultiViews to serve extensionless URLs. ie. Where the file extension is omitted from a URL that would otherwise map to an existing file. However, be aware of potential ...
MrWhite's user avatar
  • 42.8k
4 votes

How do I use URL redirection with reverse proxy?

Under Apache, using the ProxyPassReverse directive will do what you want. It will take the redirect from the backend server and replace the backend host name with the front end name. From the ...
Stephen Ostermiller's user avatar
4 votes
Accepted

NGINX - Rewrite .js.php file to .js

If the underlying filename is script.js.php then it doesn't make sense to rewrite this to script.js - as that would result in a 404. However, the directives you posted would seem to result in a 404 ...
MrWhite's user avatar
  • 42.8k
4 votes
Accepted

Multiple rules to rewrite the url

Yes, you have a conflict. Both your .htaccess rules have exactly the same conditions, so the first one is always going to win. The second is never going to be executed. Your URL structure is ...
MrWhite's user avatar
  • 42.8k
4 votes

Adding IDs to urls to open up namespace - SEO considerations?

If you correctly put in 301 redirects and update your sitemap, the site will be fine. However... What are you trying to gain from this change? The Stack Exchange-style hierarchy doesn't make sense ...
Warren Halderman's user avatar
4 votes
Accepted

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

Your rewrite rules use absolute URLs that include the protocol and host name. Internal rewrites only work with relative URLs that have just the path. When mod_rewrite encounters an absolute URL for ...
Stephen Ostermiller's user avatar
4 votes
Accepted

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

The mod_alias Redirect directive uses prefix-matching and everything after the match is copied onto the end of the target URL. You can use RedirectMatch (which uses a regex as opposed to simple prefix-...
MrWhite's user avatar
  • 42.8k
4 votes

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

I always lean towards descriptive urls. They are easier for the users to understand. They are easier to maintain. And they have a tiny bit of impact on ranking. Google : URL structure best practices ...
Rohit Gupta's user avatar
  • 2,466
3 votes

How do I implement URL rewriting in my .htaccess file?

As addition to above answers one can use RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.html -f RewriteRule ^([\w-]+)$ $1.html [L] ([\w-]+) Allows letters, ...
Abhishek Gurjar's user avatar
3 votes
Accepted

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

...does that mean that all http to https "rewrites" are actually redirects? Yes. They are external redirects, not internal rewrites. But rewrite does all the changes server side and are invisible ...
MrWhite's user avatar
  • 42.8k
3 votes

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

If the URL contains a / followed by any characters or none followed by a / followed by sitename followed by any characters or none, remove sitename: rewrite ^(.+)/sitename(/.*)$ $1$2; ...
Richard Smith's user avatar
3 votes

Properly force SSL with .htaccess, no double authentication

This works perfect for what I'm trying to do, I have some PHP based admintools in respective directories under /admin/, in /admin/.htaccess I have listed: SSLOptions +StrictRequire SSLRequireSSL ...
Sm0k3's user avatar
  • 31
3 votes

Rewrite and hide page ID from URL

In your case, use actual event names instead of ID numbers as unique values both in the URL and any database you are running in the back-end of your website. Your rewrite rule probably (assuming your ...
Mike -- No longer here's user avatar
3 votes
Accepted

How to redirect old parameter based content without jeopardizing SEO

Using a 301 redirect from the old links to the new links should carry the SEO you've built up to the new links. For example, Google's Webmaster Support says "If you need to change the URL of a page ...
wogsland's user avatar
  • 150
3 votes

Is it a Good Practice to move a blog from HTTP to HTTPS?

Google deals with HTTPS redirection absolutely fine and maintaining the ranking. Generally, when you move to HTTPS, you may not notice a ranking drop at all. In some cases even if there will be a ...
TopQnA's user avatar
  • 3,173
3 votes

How to correctly update a Wordpress URL?

Install the Redirection plugin for WordPress. (https://wordpress.org/plugins/redirection/) Then change the URL's in each individual page's settings. Redirection will automatically 301 redirect the old ...
Henry Visotski's user avatar
3 votes
Accepted

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

Finally, I have found the problem. Problem had caused by host settings. Due to some issues, I had to define subdomain as an independent domain in the host. This raised issues with Redirects. Because, ...
Pasakgroup's user avatar
3 votes

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

But, none of them works properly, and they will redirect to ssl www version of root-domain, instead of ssl www version of subdomain. (I'm assuming all your subdomains map to the same area of the ...
MrWhite's user avatar
  • 42.8k
3 votes

IIS URL Rewrite: Pattern starting with forward slash never matches

I guess you're referring to the Match URL pattern field, this one: In that case the values received always start without the first / and don't include the Query String parameters either (if you need ...
jalarcon's user avatar
  • 346
3 votes
Accepted

Rewrite rule not taking effect

Assuming you have a RewriteEngine On directive then... RewriteRule ^jbossas/jboss-configuration jboss-server/jboss-configuration [R=301,L] By itself, this directive would likely result in a ...
MrWhite's user avatar
  • 42.8k
3 votes
Accepted

Order of RewriteRules is affecting the result

RewriteRule ^([\w-]+)/([a-z0-9]+)/([a-z-0-9]+)$ index.php?p=$1&bay=$2&map=$3 [L] RewriteRule ^test/([\w-]+)/(\d+)$ index.php?page=$1&tab=$2 [L] You basically have a "conflict" with these ...
MrWhite's user avatar
  • 42.8k
3 votes
Accepted

Removing PHP Extension in sub directory

If I try to go to /admin or /admin/ without specifying the filename I get this error: Because /admin/ is a directory and your directive only checks that the request does not map to file. So the ...
MrWhite's user avatar
  • 42.8k
3 votes

How to change the URL of a wordpress website?

Two questions in 1 ;) For the first one, redirect example.com/wp to example.com, you must first set your domain to point to the wp directory rather than to its parent directory (www, htdocs...). Then ...
gael's user avatar
  • 1,050
3 votes
Accepted

Adding IDs to urls to open up namespace - SEO considerations?

There is a risk with URL changes of SEO problems, ranking loss, and traffic declines. When correctly implemented with 301 redirects, it can go perfectly fine, but it doesn't always do so. I ...
Stephen Ostermiller's user avatar
3 votes

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

example.com/index.php/somefolder/anotherfolder/file/query... Everything after the file index.php in the URL is called "additional pathname information" (or path-info for short). Whether this is valid ...
MrWhite's user avatar
  • 42.8k
3 votes
Accepted

Url changing with htaccess

It looks like you are making this more complex than it actually is. Unless you need to be specific about matching "club", it looks like you just need to remove the first path segment when it ...
MrWhite's user avatar
  • 42.8k

Only top scored, non community-wiki answers of a minimum length are eligible