Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
9 votes
3 answers
42k views

How to redirect / convert any URL to lowercase?

I am using: <IfModule mod_rewrite.c> Options +FollowSymLinks RewriteEngine On RewriteCond %{HTTP_HOST} ^example\.com [NC] RewriteRule (.*) http://example.com/$1 [L,R=301] </...
pelajar's user avatar
  • 93
8 votes
3 answers
50k views

How to remove trailing slashes from URL with .htaccess?

The situation Across the entire domain, we'd like the URLs to hide file extensions and remove trailing slashes, independent of the domain name itself (as in, works on any domain). Sample of our ...
Matt's user avatar
  • 604
5 votes
3 answers
270 views

Organizing website files

I want to start creating my website but I have a few questions. http://website.com/directory/webpage - in this kind of website, it does not display a .php or .HTML extension at the end. How to ...
Joe Slater's user avatar
5 votes
1 answer
6k views

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

I have a simple question, yet I've found no posts that answer my question. I need an htaccess file that rewrites the urls so that it removes the ending / if any, and adds .php no matter what the ...
Aaron Esau's user avatar
5 votes
1 answer
1k views

How can redirect pages from old core PHP site to new Joomla site?

We have our old site into core PHP and we have developed it again into Joomla 1.5 last year (because of some limitations we have to build it into 1.5). Now the problem is the URL of sites changed as ...
pkachhia's user avatar
  • 203
5 votes
1 answer
2k views

URL masking with .htaccess

I need a hardcore programmer to help me with URL masking. So this is my situation. My website www.michaelfotograf.dk/blog/ is the main site that needs to be configured. I have another website/...
Michael Nguyen's user avatar
4 votes
6 answers
304 views

Should my users' profile page URL be /user/bob or just /bob?

Currently, the URL to a user's page is this: website.com/user/bob But I'm considering changing this to be: website.com/bob Without the /user/ part. It comes across as much cleaner and easier to ...
user896541's user avatar
4 votes
6 answers
869 views

SEO - which URL's are the best?

I'm using .htaccess with RewriteRule to create SEO-friendly URL's. However, I have a few questions about this: First of all, I noticed many websites end their URL's with .html (or another extension)...
Bv202's user avatar
  • 143
4 votes
2 answers
2k views

How to correctly remove MULTIPLE parameters from the Google index using htaccess and canonical / noindex?

I found a similar question with a great answer for removing a single URL parameter. However, what if I have 20+ URL parameters that I don't want indexed? Also, in the example solution below, it is ...
Bryan Earl's user avatar
4 votes
1 answer
4k views

How can I redirect old WordPress URL (with a query string) to new URL using .htaccess?

I transferred my WordPress site to static HTML website, but some other website have a link to my old WordPress site mysite.com/?page_id=1103. I want to redirect all traffic to new URL which is mysite....
user2161017's user avatar
4 votes
1 answer
303 views

Hosting multiple sites - Mask URL?

I have a hosting account where I have my main site (www.mainsite.com points to root folder), and a subfolder xpto.com, where I want to have another site (www.xpto.com). I can access www.anothersite....
user avatar
4 votes
2 answers
2k views

How do I redirect an English language URL to an Arabic language URL?

I have a link that's currently formatted like this: http://example.com/news/view/1.html I want to it redirect it to: http://example.com/خبر/عنوان-الخبر where خبر is equal to news and عنوان-...
Jason4Ever's user avatar
4 votes
1 answer
4k views

Can .htaccess 301 redirects work with encoded characters?

I have an old site with titles in the URL for SEO, but it has URL encoded characters than transliterated Latin characters. Like %20 instead of space character and many other non-Latin characters. The ...
user45881's user avatar
4 votes
2 answers
815 views

Google didn't update the search results after changing a URL with a permanent redirect

I have a simple personal webpage which I use to list my publications and link the corresponding PDFs (I work in academia). Until now, this webpage was hosted by my university: http(s)://...
Arkandias's user avatar
  • 141
4 votes
1 answer
658 views

Redirect domain name to a specific page

I have theses domain names installed: Main domain name: www.example.com Others domains: www.example.org www.example.fr www.animals.example I first made a rule on my .htaccess to redirect all ...
Lucien's user avatar
  • 41
3 votes
2 answers
44k views

Configure clean URLs for Laravel using a rewrite rule to index.php

Recently I've started learning Laravel , I have none experience with framework before. I'm encountering the following problem .I'm trying to configure the .htaccess file so I can have clean URLs but ...
giannis christofakis's user avatar
3 votes
1 answer
752 views

Are there any tools in Google Search Console for removing URLs with 301 redirects?

In Google Search Console, I am getting 15-20 all different URLs in 404 section which is not in proper format(this URL is too old around 6-7 years and there is no 'Linked from' for this URLs). I want ...
yajiv's user avatar
  • 151
3 votes
2 answers
578 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. ...
Hulio-G's user avatar
  • 81
3 votes
1 answer
6k 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 ...
mario's user avatar
  • 229
3 votes
1 answer
78 views

How to have my customized extension?

I have recently found a .htaccess trick in which I can remove file extension from the URL, example.com/file.html looks like example.com/file Now my humor says that I can replace any extension to my ...
Santosh Kumar's user avatar
3 votes
2 answers
651 views

Building a webcomic: How to redirect URL to latest slug using htaccess?

I'm inexperienced with coding. I have a comic that creates new pages as /?pg=pagenumber I want visitors to be redirected to the latest page. So when they type: https://example.com they get redirected ...
redmoon321's user avatar
3 votes
1 answer
680 views

Non-existent subdirectories of index.php do not return "404 not found"

My website usually correctly returns 404 not found errors if I enter names of documents or folders that do not exist. However, I have recently noticed something strange. The homepage of my website is ...
Run_Script's user avatar
3 votes
1 answer
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: ...
Vaibhav Singh's user avatar
3 votes
1 answer
921 views

How do I use htaccess to make a short URL to a MediaWiki page?

I'd like to rewrite /liam to /index.php/Liam_Edwards-Playne. I've currently written this below in the appropriate .htaccess file but it is still returning a 404: RewriteEngine On RewriteRule ^/liam$ %...
liamzebedee's user avatar
3 votes
2 answers
11k views

Removing .html and index.html from URL

I'm having some problems trying to Remove the .html extension from URLs Removing 'index.html' from an URL 1) To remove the extension I have tried using this in my htaccess file. RewriteEngine on ...
James Turner's user avatar
3 votes
1 answer
2k views

.htaccess redirect url to a subfolder on a subdomain with exceptions

I have a CMS installed on a subdomain (say blog.domain.com). I created a site on it but the site can be accessed at (blog.domain.com/sites/mysite). I also have to use other links like blog.domain.com/#...
takeradi's user avatar
  • 131
3 votes
1 answer
1k views

CMS Made Simple: Why does home page return a 404 under www subdomain?

Anyone know why my homepage won't load with the www prefix. Links such as www.example.com/about-us will load fine but www.example.com returns a 404. Every page works including the home page if ...
user avatar
3 votes
1 answer
345 views

Issue with 301 redirect to Index page only

I have a bunch of 301 redirects in my .htaccess for old pages, which work great. But a problem that's been plaguing me for years is that there's a lot of links out there to my old index page (index....
ola.rogula's user avatar
2 votes
2 answers
4k views

Which method is better to add "www." before domain name

I have search through Google and found 2 methods to add www before domain name. First is by adding a CNAME and second is using rewrite mod in .htaccess file. I just want to know which method is ...
user avatar
2 votes
2 answers
164 views

Replacing an existing website – SEO considerations for broken links?

I have built a new website to replace a client's existing company website on the same URL. The content is entirely different, and none of the page links are the same. Do I have any issues to worry ...
jasonbradberry's user avatar
2 votes
2 answers
709 views

Can you rewrite the root?

Not sure how to word this one but will explain most I can. I am trying to make the following happen. Re-write this http://example.com To this http://example.com/home/ Is it possible ? update ...
Mr Obvious's user avatar
2 votes
2 answers
2k views

Rewrite rule for pretty URL: redirecting 'index.php?parameter' to 'slug/index.html'

My original URL is: http://example.com/video_in.php?video_id=1 and I want my link to be: http://example.com/shaandaar/kinna_sona.html shaandaar and kinna_sona are the slugs in my database. ...
Aman patel's user avatar
2 votes
1 answer
597 views

Problem with my subdomain with .htaccess root as subdir

I am working on a site making my subdir to appear as root just like //example.com/ is //example.com/subdir and also access/load files hiding the subdir. My site have this .htaccess (below) and its ...
seventhief's user avatar
2 votes
1 answer
44 views

I can't run 2 or more url rewriting rules at once

I was trying to shorten the URL more, but I was removing .php file extension from the URLs using URL rewriting too. I can't run both at the same time. Removing the extensions and trying to shorten ...
Don Paul's user avatar
2 votes
1 answer
60 views

Redirecting /page/*/ to the home page in .htaccess

My problem is that my homepage exists on https://www.example.com/page/2/, /3/, /4/ and so on, it still exists on /1000/. Same duplicate page versions exists on /about and and /contact page of my site. ...
Eym Script's user avatar
2 votes
2 answers
2k views

How to redirect urls without cpanel access

My client is a CPA firm that had a website built with a CPA site builder company. They no longer want that site, but I have earned them good rank with many of their local keywords. We have designed a ...
SCook's user avatar
  • 21
2 votes
2 answers
1k views

How do I link to web pages with umlauts in their filename?

I am trying to create an HTML link to a web page hosted on an Apache server that contains umlauts (in my test case it is ä.html). So I tried the following in HTML: <a href='ä.html'>ä.html</...
René Nyffenegger's user avatar
2 votes
1 answer
80 views

Can I create a keyword subdirectory for my home page to help SEO?

My website consists of an English-language Homepage (my index.html file), and a German and Russian translation of this page (de.html + ru.html), which are accessible through a button on the top-right. ...
Jahan's user avatar
  • 21
2 votes
1 answer
2k views

How to have .htaccess display 404.html for child pages

I am working on a website example.com that has an error page example.com/404.html. Here's my entire .htaccess file (Apache): # Forces HTTPS RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^(....
heyycap's user avatar
  • 25
2 votes
1 answer
483 views

My users are getting 302 Found page if they don't write https in address bar, how can I prevent this?

I host a forum website in DigitalOcean's cloud servers, using Ubuntu 16.04, Apache 2.4.20, PHP 7.0.8 and MySQL 5.7.12. I tried to troubleshoot with cURL about what is the problem, these are the ...
Beltasbur's user avatar
2 votes
1 answer
351 views

What is correct syntax for .htaccess 301 redirect of query based URL to new URL?

I wish to set up some 301 redirects to new URLs and I am trying to do this with the redirect facility in cPanel. For some reason the requests are not being processed correctly and I am guessing that ...
MrPaulDriver's user avatar
2 votes
2 answers
302 views

How do I forward/redirect a website from a folder in a subdomain to another server?

I have a client with a site at subdomain.example.com/folder. I've cloned it locally in MAMP. Once I've made some changes, I need to host it at an alternative physical server (I intend to use a ...
user avatar
2 votes
0 answers
157 views

invoke a URL Perl script silently, without changing URL visible to client

I've been fighting the Google canonical page algorithm bug for 2+ months. Following various forum advice and suggestions haven't solved it yet, although for sure they've made our website better. One ...
Jeff Brower's user avatar
2 votes
1 answer
2k views

Removing slash from directory URL

I need to somehow remove the last slash in my directory URLs. For example, instead of example.com/projects/, I'd like to see example.com/projects. I have been trying many solutions with no luck so far....
Oli's user avatar
  • 123
2 votes
0 answers
1k views

.htaccess language detection, redirect and friendly URLs [closed]

I'm having problems with my .htaccess file. RewriteEngine On RewriteCond %{HTTP:Accept-Language} (fr) [NC] RewriteRule .* http://www.example.com/frans [R,L] RewriteRule .* http://www.example.com/...
Joeri's user avatar
  • 21
2 votes
1 answer
88 views

Force url to use www [duplicate]

I'm confused about how to force my url to use www in the address. I have a .htaccess code like this: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f ...
adeade's user avatar
  • 121
1 vote
1 answer
2k views

Skip part of URL

I have a server running on XAMPP in LAN. In htdocs I've created subfolder called 'apps' (it's because I'm using one CodeIgniter's files to multiple webpages). Now, when somenone want to visit a ...
breq's user avatar
  • 113
1 vote
3 answers
301 views

500 error when implmenting SEO friendly URLs [closed]

I want to create SEO friendly URL for my website. I am creating a .htaccess file but these file not run in Bluehost. Bluehost gets an "Internal Server Error": The server encountered an internal ...
jeet sejwal's user avatar
1 vote
1 answer
942 views

Can Apache "Correct" URL Case?

Let's say I keep every word of file names capitalized. For example, Home.php or MultipleWordTitle.html. Is there any way for Apache to redirect requests for incorrectly-cased URLs to the capitalized ...
Maxpm's user avatar
  • 155
1 vote
2 answers
53 views

Rename translated documents into ending language initials

I am building a web app and trying to add two languages to the website. So I will make the same documents ending in -gr. Some examples of the files look like this: English Language paths: www....
csandreas1's user avatar