I have a url like:
http://skepticalgamer.com/category/slam-the-controller
I'd like to strip out "category" from the URL. So I'd want:
http://skepticalgamer.com/slam-the-controller
to act as if it were the original URL above. Is that something that can be done with mod_rewrite?
...
Hello!
I'm doing something very simple with mod_rewrite and it's behaving strange. It's behaving as if I'm using the [R] option, but I'm not. Here's a simple test for a .htaccess file:
RewriteEngine on
RewriteRule ^page1$ page2
This should redirect a request for page1 to page2, but leave the URL in the web browser still pointing to p...
Hello.
I'm working on a new project, using Apache's mod_rewrite and PHP to get pretty URLs.
Here's what my URLs look like:
http://example.tld/foo/bar/1/etc
Notice that there's no trailing slash (that's the way I write it in the href attributes of <a>s).
However, I'm also allowing http://example.tld/foo/bar/1/etc/ (trailing slash).
I...
I need help with a rewrite in .htaccess.
I am trying to do the following:
When a user types http://www.example.com/csc/alabama/
I need to pull info from http://www.example.com/csc/index.php?state=alabama
I thought it should be this
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^csc/([^/]*)$ /csc/index.php?state=$1 [L]
I keep ...
I have to rewrite following URLs please someone suggest .htaccess code for this.
example.com/retrieve_cat.php?subcat=364&c=134
It has to be look like example.com/category/subcategory/
Is it possible to rewrite this..? experts please suggest me.
Thanks in advance.
...
I have the following problem: I use a script that saves the referer URL. I want this URL to one of my own URLs. So let's say a users access the page http://example.com/page1 I want to rewrite that URL to http://example.com/page2 and safe the referer on that page.
I don't want to do that with a PHP script as otherwise I would have to ext...
Can someone give me the regular expression to match something like /this/is/the/path or /this/is/the/path/ and matches like:
$1=this
$2=is
$3=the
$4=path
([^/]+)/ matches one, but I'm not quite sure how to get it to repeat.
FYI: this is for a mod rewrite RewriteRule match.
...
I am planning to convert my website to a new CMS, but I would like to use mod_rewrite to seamlessly redirect old links to their new locations.
The catch is that my new blog will not have the same article numbers as the old, because I'll import some older blog entries in their first. Thus, my mod_rewrite would need to take a URL like old...
I just wanted that when this is inserted in the URL:
http://website.com/pelicula/0221889/
http://website.com/pelicula/0221889/posters/
It really goes to this (in background):
http://website.com/index.php?ctrl=pelicula&id=0160399
http://website.com/index.php?ctrl=pelicula&id=0160399&tab=posters
So I put this in my .htacc...
My ideal setup would be to take a current clients site, upload a .htaccess with a regex inside, that would match the URI, and if it finds a certain file extension, it would use the same path, but with an altered domain.
ie.
Normal path:
http://www.domain.com/something/images/someimage.jpeg
http://www.domain.com/assets/js/jquery.js
.h...
Hello.
I use mod_rewrite/.htaccess for pretty URLs. I forward all the requests to my index.php, like this:
RewriteRule ^/?([a-zA-Z0-9/-]+)/?$ /index.php [NC,L]
The index.php then handles the requests.
I'm also using this condition/rule to eliminate trailing slashes (or rather rewrite them to the URL without a trailing slash, with a...
Hello.
I use mod_rewrite/.htaccess for pretty URLs.
I'm using this condition/rule to eliminate trailing slashes (or rather: rewrite to the non-trailing-slash-URL, by a 301 redirect; I'm doing this to avoid duplicate content and because I like URLs with no trailing slashes better):
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{RE...
I currently have the following code:
RewriteCond %{REQUEST_URI} !assets/
RewriteCond %{REQUEST_URI} !uploads/
RewriteRule ^([a-z|0-9_&;=-]+)/([a-z|0-9_&;=-]+) index.php?method=$1&value=$2 [NC,L]
This works perfectly to redirect 'page/home' to 'index.php?method=page&value=home. However at some points I need to add an extra variable or...
I'm using a mod-rewrite for pretty URLs, meant to run on the domain root. Working fine but now I'm trying to make it run on a subdomain and it keeps giving "500 Internal Server Error".
The subdomain automatically redirects to the folder with that name on my hosting account (sub.domain.com shows the content of domain.com/sub/). Does it f...
I'm in the process of building an MVC web application using the Zend framework and I've encountered an odd problem.
If I have the httpd.conf VirtualHost section and the web site's root .htaccess file configured one way, Apache does not read the index.php file (i.e. www[dot]mywebsite[dot]com/ fails), writes nothing to the rewrite log and...
Hi, for some days now I have been trying to make a simple mod_rewrite rule to create friendly URLs, my web host have mod_rewrite enabled but I just can't get it to work.
All the next questions where posted by me:
.htacces to create friendly URLs
Friendly URLs with .htaccess
.htacces NOT working…
None of the answers worked, so I'm t...
Having a look at how google perceives our site at the moment and coming up short...
Basically, we use a bog-standard structure of URL rewriting to make them look SEO friendly.
for instance, a product URL takes shape of any string_([0-9]).html and so forth. of course, this allows us to link to whatever we want before the product id... ...
I am building a website that runs all of the code trough index.php.
For example index.php?controller=something&id=01234.
I want to use PHP to create friendly URLs, so I do this:
$request = str_replace('/root/', '', $_SERVER['REQUEST_URI']);
$params = explode('/', $request);
$controllers = array('first_c', 'second_c', 'third_c');
if ...
Hello,
I'm working on my project and now I want to transfer it from my localhost to server. Everything seems to work fine, but .htaccess doesn't work.
The server should be suporting mod_rewrite and print_r(apache_get_modules()); shows mod_rewrite running.
But still, when I type myaddress.com/contact, it shows error 404.
Here is the ....
I have the following regex:
RewriteRule ^blogs/([^/]*)/([^/]*) blogs/index.php?blogger=$1&blog=$2
This works fine for the following cases:
http://myurl.com/blogs/blog-name/blog-article/
http://myurl.com/blogs/blog-name/blog-article
http://myurl.com/blogs/blog-name/
however it does not handle:
http://myurl.com/blogs/blog-name
H...