Linked Questions

1 vote
1 answer
2k views

Link stylesheets up directories using .htaccess [duplicate]

How do I move up a directory using the <link> in HTML for my stylesheets to work while using htaccess? My directories are as: index.php .htaccess css/ styles.css php/ login.php In my ...
Ackados's user avatar
  • 11
1 vote
1 answer
294 views

htaccess 404 code does not trap an incorrect URL path (with a / in the string [duplicate]

I have a simple 404 redirect in my .htaccess file: ErrorDocument 401 /404.htm ErrorDocument 404 /404.htm RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://hypnosis-retreat....
Gary Lowrey's user avatar
2 votes
0 answers
27 views

Problem with URL path when I applied SEO friendly URL [duplicate]

I was working on PHP project and making SEO friendly URL Like, OLD : http://example.com/list_product?q=men-top-wear New : http://example.com/list_product/men-top-wear Here is my .htaccess file: ...
Pex Bht's user avatar
  • 21
1 vote
0 answers
20 views

SEO Rewrite , URI Without .php Extension To file [duplicate]

I have website with this output Link : https://domain1.net/estates.php?estname=XXXX&location=YYYYY I want change it to : https://domain1.net/XXXXX/YYYYY I try it with following rewrite rule : ...
Pardis's user avatar
  • 21
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
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
2k views

.htaccess -- Trailing slash and characters after file extension

I've got some weird usability warnings popping up in my search console for pages which don't actually exist on my site. It looks like someone is creating 100's of malformed links to my pages. Here's ...
Bangkokian's user avatar
2 votes
1 answer
2k views

redirect to default language directory if no language have been selected - .htaccess

basically what i have in my .htaccess is couple of lines to detected the selected fake*sub-folder language requested in the URI and redirect it automatic to ?lang=(selected language) RewriteEngine ...
Patrick jane's user avatar
3 votes
2 answers
563 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
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
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
1 vote
1 answer
1k views

How to issue .htaccess for Laravel?

I have just launched a Laravel 5.3 project on a live server and all is going well except one. But my issue is, my websites are running on all 3 different URLs: example.com example.com/public/index....
mySun's user avatar
  • 181
1 vote
1 answer
881 views

Rewrite three URL directories to corresponding PHP files and pass subdirectory as a parameter

I want to convert the following https://example.com/download-file/xyz https://example.com/download-code/abc https://example.com/developer/mno to https://example.com/download-file?name=xyz https://...
Rohit Gupta's user avatar
  • 2,466
3 votes
1 answer
397 views

Is there a way to set up a redirect in htaccess to convert a folder/paths to a params

After trawling through posts I have this RewriteCond %{HTTP_HOST} ^example.software$ RewriteRule ^downloads$ https://example.software\?mode\=downloads&%{QUERY_STRING} [R=302,L] This works fine ...
Rohit Gupta's user avatar
  • 2,466
2 votes
1 answer
349 views

htaccess Redirect everything to index.php little trouble

I need to redirect everything (www.example.com/, www.example.com/en/, www.example.com/en/index.php?do=xyz, etc.) to index.php, but I can't get everything working. 1st try: RewriteCond %{...
Mario Bruscella's user avatar

15 30 50 per page