is there a way to hide IDs using only .htaccess and without changing my php code?
htt://www.domain.com/show.php?categoryID=2&cname=electronic&productid=21&name=laptops
to
htt://www.domain.com/electronics/laptops
thanks in advance.
...
Hi
I am using below rule to read the URL like
URL:
http://www.example.com/blog/sampe-post-title/10004/
RULE:
RewriteRule (.*)/(.*)/([0-9]+)/$ $1/details.asp?mod_id=$3 [NS,I]
Everything was fine untill I discovered that links coming via feedburner are not working anymore. Because feedburner adds some extra parameter to URL for stat...
How would I rewrite:
character.php?name=Agame
to:
character/Agame
...
This is the code I use,
<IfModule mod_rewrite.c>
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^([^/]+)/?([^/]+) index.php?user=$1&do=$2 [L]
</IfModule>
if i give it abcd/1234 it will capture abcd first then 1234 as the second variable. But if the url was abcd/ or abcd the first capture stays th...
Amazon EC2 with Fedora, there are 2 instances of the httpd conf, the doc root is automatically set as /home/webuser/helloworld/conf/httpd.conf and the default (which is also there) is /etc/httpd/conf/httpd.conf . Mod rewrite is enabled with both, we are in drupal, the .htaccess is in the folder it needs to be (on Drupal) and it loads t...
What would I make this rule so that you can access it with and without trailing slash?
RewriteRule ^members/([^/]+)$ members.php?id=$1 [L]
...
This is my htaccess file
RewriteBase /
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
RewriteCond %{REQUEST_URI} !^/chat/
RewriteCond %{REQUEST_URI} !^/m/
RewriteCond %{REQUEST_URI} !^/__admin/
RewriteCond %{REQUEST_URI} !^/gzip_headers.php
RewriteCond %{REQUEST_URI} !^/phpfreechat/...
I want to have my primary domain be hosted from a subdirectory (have completed this step somewhat), i.e. when someone types in www.example.com/news behind the scenes it will go to www.example.com/subdirectory/news but will still show up as www.example.com/news.
I have used the following bluehost code to accomplish this:
RewriteEngine o...
I am migrating my application which provides a subsite for each user from domain.com/~user to user.domain.com. In order to do this, I wrote the following RewriteRule:
RewriteRule ^~([a-z_]+)(/.*)?$ http://$1.%{HTTP_HOST}$2 [R=301,QSA,NC]
However, %{HTTP_HOST} doesn't do exactly what I need it to, because if for instance a user browses...
Hi,
here is my .htaccess rules:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(.*)/(.*)$ index.php?var1=$1&item=$2&var2=%{REQUEST_URI} [NC,L]
RewriteRule ^(.*)$ index.php?var1=$1 [NC]
here is an url:
http://loc...
Hello!
My .htaccess file has the following code:
RewriteEngine on
RewriteRule ^/?(.*)$ index.php?domain=$1 [L]
I'm trying to get domain names as variables from URLs like:
hxxp://www.example.com/www.domain.name or
hxxp://www.example.com/subdomain.domain.name or
hxxp://www.example.com/domain.name
but with $_GET['domain'] my variabl...
Hello,
This is my url
http://mydomain.com/Anonymous/47/comments.php
My file hosting script contains lots of rewrites, So how can I redirect this particular type of url to comments.php without conflicting with other rewrites.
My htaccess file
Options +FollowSymLinks
RewriteEngine on
##point to installation directory
##if it is ...
I thought about hitting a file via -f (i think it is) in a mod_rewrite RewriteCond, if the file exists, rewrite to maintenance page. I don't think the performance penalty should be too big, but maybe people had other experiences or objections on this idea?
...
I'd like to have my .htaccess file specify a different RewriteBase depending on whether the .htaccess file is on my local machine or on a web server. This is the mod_rewrite code I tried, however, it did not work:
RewriteCond %{HTTP_HOST} ^localhost:8080
RewriteBase /example/
RewriteCond %{HTTP_HOST} ^www.example.com
RewriteBase /
Th...
I have been trying to add a mod_rewrite to a site but its only barely working.
This URL, "http://domain.com/folder/server/subfolder/index.php" should be rewritten to "http://domain.com/folder/subfolder/index.php?platform=server"
This is the last version i'v tried so far.
RewriteEngine On
RewriteCond %{REQUEST_URI} !(css|images|scripts...
Hi folks,
Using this rewrite rule is giving me a 500. What is wrong with my syntax?
Options +FollowSymlinks
RewriteEngine on
RewriteBase /
RewriteRule ^microsites/(.*)$ /microsites/index.php?uID=$1 [L]
What I want to do is silently write http://site.com/microsites/anythingatall to http://site.com/microsites/index.php?uID=anythinga...
So I recently switched away from wordpress. Wordpress keeps all of it's feed URLs at /feed/. This seems reasonable to me, so I never signed up for a site like feedburner.
Now I'm using an entirely new blog software, and it puts the feed at /atom.xml.
How can I use the .htaccess file to redirect requests to /feed/ to /atom.xml? Or maybe...
The company I work for has their own Flash based video player and the question I get from our execs is "Can we tell what website our player is embedded on?"
At first, I hypothesized I could use Apache mod_rewrite, extract the HTTP_REFFER, and append it to the end of the requested URL. So as the browser gets http://.../viewer.swf, I coul...
I am trying to find the correct mod_rewrite code for the following case:
domain.de => www.domain.com/de/
domain.de/... => www.domain.com/...
www.domain.de => www.domain.com/de/
www.domain.de/... => www.domain.com/...
domain.com => www.domain.com/en/
domain.com/... => www.domain.com/...
www.domain.com => www.domain.com/en/
www.domain.co...
Complete Apache newbie here. I'm trying to get my main URL to redirect to the www. Here's the code I'm using:
RewriteCond %{HTTP_HOST} !^www\.domain\.com
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=permanent,L]
The problem is, this has wrecked my subdomains. sub.domain.com goes to www.sub.domain.com, which doesn't work. So what d...