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
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
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
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
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
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
1 vote
1 answer
260 views

FrontController dosen´t work

i have a example FrontController, its really simple. index.php: if (isset($_GET['page'])) { $requested_page = $_GET['page']; } else { $requested_page = 'home'; } switch($requested_page) { ...
Denis Jurkovsek's user avatar
1 vote
1 answer
133 views

Use .htaccess to make pretty URLs that expand abbreviation codes

Yes, I know, there are tons of questions like this, but I can't find one which solves my problem so at cost of receiving downvotes I'm going to ask this again. Even a duplicate link may help me. This ...
Cliff Burton's user avatar
1 vote
5 answers
25k views

Remove folder name from rewritten URLs

Consider this URL: http://example.com/gallery/20141111-some-title In this URL I want to hide gallery/: http://example.com/20141111-some-title How can I achieve this using mod_rewrite? I used ...
user46547's user avatar
1 vote
1 answer
284 views

htaccess - "detect" url and redirect

Idea is: if URL = "http:/localhost/site/" else if URL = "http:/localhost/site" redirect to "http:/localhost/site/index.html" Can this be done with .htaccess / Apache mod_rewrite and how?
user avatar
1 vote
1 answer
2k views

Using RewriteBase in .htaccess to make links pretty

I'm working on a project right now and I'm trying to make the links pretty. We have urls like this: http://subdomain.domain.com/DynamicCountry/DynamicName/file.php What I'm trying to do is set the ...
Timr's user avatar
  • 113
1 vote
1 answer
324 views

How to block access to a sub-site with mod_rewrite?

Let's say I have the sites siteA.com and siteB.com. They are hosted such that siteB.com actually points to siteA.com/siteB. How can I block someone from visiting siteA.com/siteB using mod_rewrite? ...
Chris Laplante's user avatar
0 votes
1 answer
2k views

Link to pages on site without .html extension appearing in browser?

I've modified my .htaccess file to allow access to html files without having to include the extension on the end, for example: www.mysite.com/document directs to www.mysite.com/document.html ...
Anime163's user avatar
0 votes
1 answer
205 views

Capitals in URL subdirectory not changed by htaccess

Within my WordPress website I am redirecting sub directories to internal and external links. Now, when you place a CAPITAL letter in the sub dir it does not work anymore and the website does not show ...
Thijs van Oorschot's user avatar
0 votes
1 answer
63 views

How can I rewrite to my .htaccess in PHP? [duplicate]

How to rewrite my URL from http://www.mysite.com/listingsecond.php?ID=1 to http://www.mysite.com/listingsecond? How can I rewrite to my .htaccess in PHP to do this?
user36356's user avatar