All Questions
95 questions
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]
</...
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 ...
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 ...
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 ...
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 ...
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/...
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 ...
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)...
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 ...
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....
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....
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
عنوان-...
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 ...
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)://...
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 ...
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 ...
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 ...
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. ...
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 ...
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 ...
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 ...
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 ...
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:
...
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$ %...
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
...
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/#...
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 ...
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....
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 ...
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 ...
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
...
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.
...
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 ...
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 ...
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.
...
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 ...
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</...
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.
...
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 ^(....
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 ...
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 ...
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 ...
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 ...
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....
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/...
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
...
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 ...
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 ...
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 ...
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....