All Questions
95 questions
1
vote
4
answers
3k
views
Using a .htaccess to RewriteRule and Redirect 301 at the same time?
I have a couple of specific URLs that I want to display differently on my website, like this:
RewriteRule ^contact$ contact.php
To get ride of the ".php" extension.
And to be SEO friendly (to avoid ...
1
vote
1
answer
953
views
How can I setup a redirect using an .htaccess that would keep part of the URL path?
I would like to setup a redirect using an .htaccess file which keeps part of the URL's path in the target URL. For example:
I have the domain example.com. I want example.com/social to redirect to ...
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
1
answer
2k
views
Showing content from pages at different URL's (masking), possibly with .htaccess
If I have URL's like:-
domain.com/category/widgets/filter/blue
domain.com/category/widgets/filter/red
And it is pretty difficult to reconstruct them to something like:-
domain.com/category/blue-...
0
votes
1
answer
87
views
Redirect blog archive into certain format
I asked the question in WPSE before, but the answer I got so far is a complicated one. I'm actually looking for a .htaccess way. Here's what the scenario is:
My blog archive URLs were like:
http://...
0
votes
1
answer
145
views
301 redirect specific URLs
I have a lot of 404 pages looks like that:
lalala/lalala/Users_PasswordReminder.aspx?something=lala
lilili/lilili/Users_PasswordReminder.aspx
/Users_PasswordReminder.aspx?username=admin
etc.
I want ...
0
votes
1
answer
351
views
Shorten URL with Regex
Here's an example URL to a user profile on my site: http://127.0.0.1:8080/overview/showuserprofile/user
I want it to be:
http://127.0.0.1:8080/user
This is what I have for rewrite rules:
...
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?
1
vote
1
answer
24
views
find-new/posts&recent=1 as homepage: what about SEO? [duplicate]
I can't change the URL of my website with .htaccess, because the query does not work anymore if I make it a pretty URL, so I am desparate to know what impact this will have on SEO. I mean, I have to ...
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
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 ...
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
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 ...
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....
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 ...
0
votes
1
answer
740
views
htaccess redirect pages that don't exist
I have a website that has a little over 100 members. Each member gets a replicated website, and by default the software we use sets up their replicated website at a url like:
domain.com/?username
"...
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 ...
1
vote
2
answers
2k
views
Redirect incomplete URL to index page
I want to redirect specific URLs to the index page not to 404 error page (ex: http://www.website.com/trip-15).
If I remove any character from the URL it will go to 404 error page (ex: http://www....
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 ...
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
...
0
votes
2
answers
343
views
How to change a URL using .htaccess
I don't know anything about coding, but I really want to change the URL of my pages:
site/data/9/Symbian-3rd-Apps.html to site/symbian_applications.html
site/data/file/352/Core-Video-Player-Symbian-...
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 ...
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 ...
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$ %...
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/...
1
vote
1
answer
182
views
Apache URL Rewrite
I'm trying and failing to get a URL rewrite working, firstly I'm doing it in the vhost declaration, is that right?
What I'm trying to do is take any URL which has;
view.php?id=[a 1 or multidigit ...
2
votes
2
answers
300
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 ...
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
...
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
...
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?
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 ...
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 ...
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....
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 ...
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
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
...
1
vote
1
answer
3k
views
URL redirection to same domain on different server
We have existing domain on non-IIS server and now we have moved it to IIS server. Client want us to redirect the URL from existing server to new server with same domain name.
We will modify the ....
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]
</...
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 ...
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)...
1
vote
1
answer
243
views
product in multiple categories - duplicate content problem [duplicate]
Possible Duplicate:
Content appearing under multiple categories; anything I can do to prevent duplicate penalty?
What is the best practice to display a product that may be in several categories ...
0
votes
1
answer
84
views
Trouble with .htacess redirection
I use this redirect rule to redirect users from www.domain.com/admin to www.domain.com/wp-admin on a WordPress site.
RedirectMatch 301 \@admin http://www.domain.com/wp-admin
The problem is that ...
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
عنوان-...
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?
...