[Solved] Hide “index.php” from URL and get parameters [duplicate]

Yes, yet another .htaccess answer 😉 Options +FollowSymLinks -MultiViews RewriteEngine On RewriteBase / # Internally forward /x/10 to /index.php?x=10 RewriteRule ^x/(.*)/?$ index.php?x=$1 [L,QSA,NC] This will redirect: http://yourdomain.com/x/10 Internally to: http://yourdomain.com/index.php?x=10 So on the user does not see that on the browser. As for the link to learn about it, I found this a very good … Read more

[Solved] How can write a clean url in php? [duplicate]

What you are really asking is that the request to details.php gets routed to index.php. You will therefore need some code in index.php to understand this request is for details. You can use this in your .htaccess file RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-l RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 In … Read more

[Solved] .htacces – how to use [closed]

Basically, and simple if you were to rewrite www.site.com/news.php?id=123 to www.site.com/this_is_news_title You should create a file called .htaccess and put it inside your htdocs folder and write in it the following Options +FollowSymLinks -MultiViews # Turn mod_rewrite on RewriteEngine On RewriteBase / RewriteRule ^news/([0-9]+)/.*$ /news.php?id=$1 [QSA,L,NC] Try it and play around with it. solved .htacces … Read more

[Solved] Need assistance with regards to htaccess

This should work: RewriteEngine on RewriteCond %{THE_REQUEST} ^(GET|POST)\ /FLSD/DSS/\?d=([0-9]+)\ HTTP RewriteRule ^ /FLSD/DSS/%2\? [R=301,L] RewriteRule ^FLSD/DSS/([0-9]+)/?$ /FLSD/DSS/?d=$1 [L] It will convert http://something.com/FLSD/DSS/?d=624 into http://something.com/FLSD/DSS/624/ 3 solved Need assistance with regards to htaccess

[Solved] How to do this: example.com/users/user1 [closed]

You need somthing like this? Not clear what is your requirement. Check this blog for more Rewriting example.com/user.php?username=xyz to example.com/xyz RewriteEngine On RewriteRule ^([a-zA-Z0-9_-]+)$ user.php?username=$1 RewriteRule ^([a-zA-Z0-9_-]+)/$ user.php?username=$1 Refer htaccess2 tricks solved How to do this: example.com/users/user1 [closed]

[Solved] What PHP Script will do this function: [closed]

You have 2 options Fault: Your body of code below, caused a parse error and this is due to an unescaped quote in the word doesn’t Option 1: Change this body of text/code: echo ‘<!DOCTYPE HTML PUBLIC “-//IETF//DTD HTML 2.0//EN”> <html><head><title>401 Authorization Required</title></head><body> <h1>Authorization Required</h1> <p>This server could not verify that you are authorized to … Read more

[Solved] How to prevent users from accessing .pdf files untill they are not being redirect from any page of website by using .htaccess?

Issue resolved. Thanks for your precious time. Here is my code that I’m using in my .htaccess file. RewriteEngine On RewriteCond %{HTTP_REFERER} !^http://(www\.)?example\.com/ [NC] RewriteCond %{REQUEST_URI} !hotlink\.(gif|png|jpg|doc|xls|pdf|html|htm|xlsx|docx|mp4|mov) [NC] RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in.*$ [NC] RewriteRule .*\.(gif|png|jpg|doc|xls|pdf|html|htm|xlsx|docx|mp4|mov)$ http://example.com/ [NC] Hope now you all understand that what I wanted to do. solved How to prevent users from accessing .pdf … Read more

[Solved] A specific htaccess inquiry [closed]

I think, this doesn’t really make sense. As stated in the comments, you can use mod_rewrite to send your shortened URLs to the controller, but controller and function need to be static. So having a separate function doesn’t really help, controller should be enough. One thing you could do is selecting the RewriteRules in your … Read more

[Solved] URL Redirect / URL Masking [closed]

Try creating .htaccess and putting the following in it: <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^ICEEC$ viewjc.php?id=c5 [L] RewriteRule ^ICEEC/$ viewjc.php?id=c5 [L] </IfModule> Make sure that the viewjc.php is at the same directory as your .htaccess If you’re just trying to change URL address bar when someone visits particular page of your website, add this to … Read more

[Solved] How to redirect index.php to root in htaccess? [closed]

You’d first redirect to pretty-url if the raw request matches: RewriteEngine On RewriteCond %{THE_REQUEST} ^GET\ /login\.php [NC] RewriteRule ^login\.php$ /login/ [R=301,L,NC] Now, you deal with the rewritten url to internally redirect to correct page: RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^login/?$ /login.php [NC,L] solved How to redirect index.php to root in htaccess? [closed]