All Questions
16 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
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 ...
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
عنوان-...
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
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 ...
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 ...
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) {
...
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 ...
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 ...
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?
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 ...
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?
...
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
...
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 ...
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?